Functional Programming & Proofs


Sample Applications

Neural nets
How to ...

  1. Define the sum of two vectors in F# (<+>) ?
  2. Get the product of a value and a vector (<*>) ?
  3. Define the "dot" product operator (<.>) ?
    Ex. [1.1;0.5] <.> [0.2;-1.0] = -0.28
  4. How to generate the following dataset ?
 x  |  y
0.0 | 1.0
0.1 | 1.2
0.2 | 1.4
...
1.0 | 3.0
  1. By considering the following definitions, how to recursively apply u for all the values of the dataset ?
let W       = [1.1;0.5];;
let u W x y =
  let X  = [x;1.0]
  let ke = 0.1*(y - (W <.> X))
  W <+> (ke<*>X);;
  1. How to repeat the process of the preceding question 1000 times ?
  2. The preceding code computes a linear regression by the way of a neural network. But how to compute a polynomial regression ?