You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, it seems like the output from the forward pass zeros out with this small example below:
import arraymancer
let ctx =newContextTensor[float32]
network ctx, Test:
layers:
hidden1: Linear(2,3)
output: Linear(3,2)
forward x:
x.hidden1.relu.output
let model = ctx.init(Test)
var optim = model.optimizerAdam(learningrate=0.001'f32)
var X = ctx.variable(toTensor([[2.1,2.90],[1.001 ,0.908]]).astype(float32))
var y =toTensor([0,1]).astype(float32)
for epoch in1..10:
let output = model.forward(X)
echo output.value
let loss =sparse_softmax_cross_entropy(output, y)
echo"Loss is:"&$loss.value
backprop(loss)
optim.update()
If you simply add another sample to X and output to y, the forward pass acts normally. Not quite sure why this is.
The text was updated successfully, but these errors were encountered:
Hello, it seems like the output from the forward pass zeros out with this small example below:
If you simply add another sample to X and output to y, the forward pass acts normally. Not quite sure why this is.
The text was updated successfully, but these errors were encountered: