def train(self, **kwargs):
        if not hasattr(self, 'get_grads'):
            raise TypeError('Non-output layer does not support this method')
        new_obj = utils.copy(self)
        try:
            o_args, o_kwargs = new_obj.prev_args
        except:
            o_args, o_kwargs = ([], {})
        kwargs = dict([(k, new_obj.tensor_from_layer(v)) for k,v in kwargs.items()])
        for (k,v) in kwargs.items():
            o_kwargs[k] = v
        new_obj.prev_args = (o_args, o_kwargs)
        new_obj.get_grads(*o_args, **o_kwargs)
        return new_obj
Compute the cost and gradients of the current layer with respect to
dataset/ETHPy150Open pascanur/GroundHog/groundhog/layers/basic.py/Layer.train