examples/iris_example.rb in ruby-dnn-0.16.0 vs examples/iris_example.rb in ruby-dnn-0.16.1
- old
+ new
@@ -39,10 +39,10 @@
train_iter.foreach(batch_size) do |x_batch, y_batch, step|
x = DNN::Tensor.convert(x_batch)
y = DNN::Tensor.convert(y_batch)
out = net.(x, y)
loss = lf.(out, y)
- loss.link.backward(nil)
+ loss.link.backward
puts "epoch: #{epoch}, step: #{step}, loss = #{loss.data}"
opt.update([w1, b1, w2, b2])
end
end