

@wraps(Cost.expr)
def expr(self, model, data):
    (space, sources) = self.get_data_specs(model)
    space.validate(data)
    (X, Y) = data
    if self.dropout_args:
        Y_hat = model.dropout_fprop(X, **self.dropout_args)
    else:
        Y_hat = model.fprop(X)
    costMatrix = model.layers[(- 1)].cost_matrix(Y, Y_hat)
    costMatrix *= T.neq(Y, (- 1))
    return model.cost_from_cost_matrix(costMatrix)

dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/costs/mlp/missing_target_cost.py MissingTargetCost.expr/original