modern-fortran / neural-fortran

A parallel framework for deep learning
MIT License
395 stars 82 forks source link

Question about input data to the quadratic function in example/quadratic.f90 #135

Closed milancurcic closed 1 year ago

milancurcic commented 1 year ago

@Spnetic-5 I meant to ask this in the PR but I forgot: Why do you square the input to the quadratic function in the example:

https://github.com/modern-fortran/neural-fortran/blob/adaf9bb28033a643cf68da40a64586ffe2184439/example/quadratic.f90#L34-L39

random_number samples x from a uniform distribution, and squaring x will skew the distribution toward low values. Did you intend to do this and why? It seems to me that we'd want to have a uniform distribution in the inputs.

Spnetic-5 commented 1 year ago

Hello @milancurcic, In x(i) = x(i) * 2 we are multiplying by 2 because it expands the range of x(i) from [0, 1] to [0, 2], and also it ensures that the input values (x) are uniformly distributed.

milancurcic commented 1 year ago

Thanks, I must be seeing double today. :)