Save loss in json format

def save(self, path):
    """Save loss in json format
    """
    json.dump(dict(loss=self.__class__.__name__,
                   params=self.hparams),
              open(os.path.join(path, 'loss.json'), 'wb'))