import torch


class MSE(torch.nn.Module):

    def __init__(self, model):
        super(MSE, self).__init__()
        self.model = model
        self.hidden_features = torch.nn.Sequential(*list(model.children())[:])

    def forward(self, x):
        return self.model(x)

    def forward_da(self, a, b, c):
        a = self.hidden_features(a)
        b = self.hidden_features(b)
        c = self.hidden_features(c)
        return (self.mse(a, b) + self.mse(b, c) + self.mse(c, a)) / 3

    @staticmethod
    def mse(x, y):
        return torch.mean(torch.pow(x - y, 2))

d1fbcf5b153c4b7d85160a3950f350bec5479571
<mask token>


class MSE(torch.nn.Module):

    def __init__(self, model):
        super(MSE, self).__init__()
        self.model = model
        self.hidden_features = torch.nn.Sequential(*list(model.children())[:])

    def forward(self, x):
        return self.model(x)
    <mask token>
    <mask token>

<mask token>


class MSE(torch.nn.Module):

    def __init__(self, model):
        super(MSE, self).__init__()
        self.model = model
        self.hidden_features = torch.nn.Sequential(*list(model.children())[:])

    def forward(self, x):
        return self.model(x)

    def forward_da(self, a, b, c):
        a = self.hidden_features(a)
        b = self.hidden_features(b)
        c = self.hidden_features(c)
        return (self.mse(a, b) + self.mse(b, c) + self.mse(c, a)) / 3
    <mask token>

<mask token>


class MSE(torch.nn.Module):

    def __init__(self, model):
        super(MSE, self).__init__()
        self.model = model
        self.hidden_features = torch.nn.Sequential(*list(model.children())[:])

    def forward(self, x):
        return self.model(x)

    def forward_da(self, a, b, c):
        a = self.hidden_features(a)
        b = self.hidden_features(b)
        c = self.hidden_features(c)
        return (self.mse(a, b) + self.mse(b, c) + self.mse(c, a)) / 3

    @staticmethod
    def mse(x, y):
        return torch.mean(torch.pow(x - y, 2))

import torch


class MSE(torch.nn.Module):

    def __init__(self, model):
        super(MSE, self).__init__()
        self.model = model
        self.hidden_features = torch.nn.Sequential(*list(model.children())[:])

    def forward(self, x):
        return self.model(x)

    def forward_da(self, a, b, c):
        a = self.hidden_features(a)
        b = self.hidden_features(b)
        c = self.hidden_features(c)
        return (self.mse(a, b) + self.mse(b, c) + self.mse(c, a)) / 3

    @staticmethod
    def mse(x, y):
        return torch.mean(torch.pow(x - y, 2))
