'Constructor.
Parameters
lfunc : str
Loss function type. Types supported:
"cross_entropy", "softmax_cross_entropy" and "mse".
summary : bool, optional (default = True)
Whether to attach a tf scalar summary to the op.
name : str, optional (default = "loss")
Name for the loss op.'

def __init__(self, lfunc, summary=True, name='loss'):

    assert (lfunc in ['cross_entropy', 'softmax_cross_entropy', 'mse'])
    self.lfunc = lfunc
    self.summary = summary
    self.name = name
