Hi Brian!



 ApeelingPotato:

return F.sigmoid (x)
Will this return a float out of the neural network?


If x is a FloatTensor, it will return a FloatTensor.  In general, it
will return a tensor of the type passed in (if the type is supported).


Im only getting 1s out of the NN.


Mathematically, sigmoid() will “saturate” and become exactly 1
when x becomes inf (and become 0 when x is -inf).
For floats, sigmoid() becomes exactly 1.0 somewhere around
x = 17.0.
Check the values of x going into sigmoid().
How large are your inputs?  Do you only get 1s out even on your
first pass before you start training?
By default, your Linear layers are constructed with “sensible”
random values for their weights.  If your inputs are of order 1,
then before you start training (that is, before the initial values of
the weights have changed) the x going into sigmoid() should
have sensible values, and you shouldn’t be getting all exactly 1s.
If the output of your network starts out not being all 1s, but then
becomes all 1s after training for a while, then your training is
pushing your network to return all 1s (which may or may not
make sense, depending on what you are training your network
to do).


I also started with using the optim.Adam and the MSELoss function


What are typical batch_Y (target) values?  And what do they
mean?  What are you trying to train your network to do?
Best.
K. Frank