예제 #1
0
    def __init__(self, layers, input_shape, output_shape):
        super(DecomposedModel, self).__init__()

        layer_modules, input_shape = generate_layers(input_shape, layers)
        layer_modules["OutputLayer"] = nn.Linear(int(np.prod(input_shape)),
                                                 output_shape)

        self.layers = nn.Sequential(layer_modules)
        self.layers.apply(weights_initialize)
예제 #2
0
    def __init__(self, network_config):
        super(_DQNModel, self).__init__()

        layer_modules, input_shape = generate_layers(
            network_config.input_shape, network_config.layers)

        layer_modules["OutputLayer"] = nn.Linear(int(np.prod(input_shape)),
                                                 network_config.output_shape)

        self.layers = nn.Sequential(layer_modules)
        self.layers.apply(weights_initialize)