import chainer

from lib.node import Input, Loss


class SoftmaxCrossEntropy(Loss):
    Input('in_array', chainer.Variable)

    def call(self):
        return 'softmax_cross_entropy(self.y, t)'


class SigmoidCrossEntropy(Loss):
    Input('in_array', chainer.Variable)
    Input('ground_truth', chainer.Variable)

    def call(self):
        return 'sigmoid_cross_entropy(self.y, t)'


class MeanSquaredError(Loss):
    Input('in_array', chainer.Variable)
    Input('ground_truth', chainer.Variable)

    def call(self):
        return 'mean_squared_error(self.y, t)'


class HuberLoss(Loss):
    Input('in_array', chainer.Variable)
    Input('delta', float)
    Input('ground_truth', chainer.Variable)

    def call(self):
        return 'huber_loss(self.y, t, delta={delta})'

@@ -266,52 +266,8 @@
 ble)
-%0A    Input('ground_truth', chainer.Variable)
 %0A%0A  
@@ -409,52 +409,8 @@
 ble)
-%0A    Input('ground_truth', chainer.Variable)
 %0A%0A  
@@ -539,16 +539,16 @@
 riable)%0A
+
     Inpu
@@ -568,52 +568,8 @@
 oat)
-%0A    Input('ground_truth', chainer.Variable)
 %0A%0A  

clean up