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)
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)