lib/dnn/core/param.rb in ruby-dnn-0.16.2 vs lib/dnn/core/param.rb in ruby-dnn-1.0.0
- old
+ new
@@ -16,11 +16,11 @@
if @data.shape == grad.shape
@grad += grad
elsif @data.shape == grad.shape[1..-1]
@grad += grad.sum(0)
else
- raise DNN_Error, "Shape is missmatch."
+ raise DNNError, "Shape is missmatch."
end
else
@grad = Xumo::SFloat[0]
end
end
@@ -32,10 +32,10 @@
def +@
self
end
def -@
- self * -1
+ Neg.(self)
end
def +(other)
Layers::Add.(self, other)
end