3 from __future__
import absolute_import
4 from __future__
import division
5 from __future__
import print_function
6 from __future__
import unicode_literals
8 from caffe2.python
import schema
9 from caffe2.python.layers.layers
import (
12 from caffe2.python.layers.tags
import (
20 def __init__(self, model, input_record, name='batch_mse_loss', **kwargs):
21 super(BatchMSELoss, self).__init__(model, name, input_record, **kwargs)
30 self.
tags.update({Tags.TRAIN_ONLY})
34 model.net.NextScopedBlob(name +
'_output'))
36 def add_ops(self, net):
37 prediction = net.Squeeze(
39 net.NextScopedBlob(
'squeezed_prediction'),
43 label = net.StopGradient(
45 net.NextScopedBlob(
'stopped_label')
48 l2dist = net.SquaredL2Distance(
50 net.NextScopedBlob(
'l2')
def is_schema_subset(schema, original_schema)