Пример #1
0
    def __init__(self, input_shape, output_shape, owner_name=""):
        super(FCNet, self).__init__(input_shape, output_shape, owner_name)

        x = input_shape
        self.model = nn.Sequential(BaseN.Flatten(),
                                   nn.Linear(np.prod(x), 1024), nn.Softplus(),
                                   nn.Linear(1024, 512), nn.Tanh(),
                                   nn.Linear(512, 256),
                                   BaseN.EigenLayer(256, self.output_shape[0]))
        self.compile()
Пример #2
0
 def __init__(self, input_shape, output_shape, **kwargs):
     super(ConvNetMNIST, self).__init__(**kwargs)
     self.n = output_shape
     self.conv = [BaseN.ResNetBlock(1, 32), BaseN.conv3_2(32, 64)]
     x = BaseN.output_shape(self.conv[0], input_shape)
     self.model = nn.Sequential(self.conv[0], nn.Softplus(),
                                BaseN.Flatten(), nn.Linear(np.prod(x), 512),
                                nn.Linear(512, 256), nn.Tanh(),
                                BaseN.EigenLayer(256, self.output_shape[0]))
     self.compile()
Пример #3
0
    def __init__(self, input_shape, output_shape, owner_name=""):
        super(FCSpectralMNet, self).__init__(input_shape, output_shape,
                                             owner_name)

        x = input_shape
        self.model = nn.Sequential(BaseN.Flatten(),
                                   nn.Linear(np.prod(x), 1024), nn.ReLU(),
                                   nn.Linear(1024, 1024), nn.ReLU(),
                                   nn.Linear(1024, 512), nn.ReLU(),
                                   nn.Linear(512, self.output_shape[0] - 1),
                                   nn.Tanh(), BaseN.EigenLayer())
        self.compile()
Пример #4
0
    def __init__(self, input_shape, output_shape, owner_name=""):
        super(ConvNet, self).__init__(input_shape, output_shape, owner_name)

        self.conv = [
            nn.Sequential(BaseN.conv3_2(input_shape[0], 8), nn.ReLU(),
                          BaseN.conv3_2(8, 16), nn.ReLU(), BaseN.conv3_2(8, 8))
        ]
        x = BaseN.output_shape(self.conv[0], input_shape)
        self.model = nn.Sequential(
            self.conv[0], BaseN.Flatten(), nn.Linear(np.prod(x), 512),
            BaseN.AdaptiveTanh(), nn.Linear(512, 256),
            BaseN.EigenLayer(256, self.output_shape[0], bias=False))
        self.compile()
Пример #5
0
    def __init__(self, input_shape, output_shape, owner_name=""):
        super(ConvNetBigAtari, self).__init__(input_shape, output_shape,
                                              owner_name)

        self.conv = [
            nn.Sequential(BaseN.conv3_2(input_shape[0], 8), nn.Softplus(),
                          BaseN.conv3_2(8, 16), BaseN.conv3_2(16, 32))
        ]
        x = BaseN.output_shape(self.conv[0], input_shape)
        self.model = nn.Sequential(
            self.conv[0], BaseN.Flatten(), nn.Linear(np.prod(x), 512),
            nn.Linear(512, 512), nn.Tanh(), nn.Linear(512, 1024),
            BaseN.EigenLayer(1024, self.output_shape[0]))
        self.compile()