autorl/agents.py
def configure(self, config=None):
        """
        Configure and compile the action value network. For now, just an
        MLP, but CNNs will be supported soon.
        :return: Compiled TF Keras model
        """

        batch_shape = tuple([None] + self._state_dim)

        if self._state_type == "vector":
            config_ = {
                        "dense_dims": list(range(self._action_dim+1, self._state_dim[0]+1))[::-1],
                        "dense_activation": "relu",
                        "output_dim": self._action_dim,
                        "optimizer": {"Adam": {"learning_rate": 0.001}},
                        "loss": {"MeanSquaredError": {}},
                        "output_activation": "linear"
            }

            if config is not None:
                config_.update(config)

            network = dense.MLP(config_)

        elif "tensor" in self._state_type:
            raise NotImplementedError("Only supporting MLPs right now.")

        else:
            raise ValueError("Unrecognized state type.")

        # compiled model
        return train.model_init(network, config_["loss"], config_["optimizer"], batch_shape)

        Configure and compile the action value network. For now, just an
        MLP, but CNNs will be supported soon.
        :return: Compiled TF Keras model
        
Configure and compile the action value network. For now, just an
MLP, but CNNs will be supported soon.
Configure and compile the action value network . For now just an MLP but CNNs will be supported soon .
def configure(self, config=None):
        batch_shape = tuple([None] + self._state_dim)
        if self._state_type == "vector":
            config_ = {
                        "dense_dims": list(range(self._action_dim+1, self._state_dim[0]+1))[::-1],
                        "dense_activation": "relu",
                        "output_dim": self._action_dim,
                        "optimizer": {"Adam": {"learning_rate": 0.001}},
                        "loss": {"MeanSquaredError": {}},
                        "output_activation": "linear"
            }
            if config is not None:
                config_.update(config)
            network = dense.MLP(config_)
        elif "tensor" in self._state_type:
            raise NotImplementedError("Only supporting MLPs right now.")
        else:
            raise ValueError("Unrecognized state type.")
        return train.model_init(network, config_["loss"], config_["optimizer"], batch_shape)
def configure ( self , config = None ) : batch_shape = tuple ( [ None ] + self . _state_dim ) if self . _state_type == "vector" : config_ = { "dense_dims" : list ( range ( self . _action_dim + 1 , self . _state_dim [ 0 ] + 1 ) ) [ : : - 1 ] , "dense_activation" : "relu" , "output_dim" : self . _action_dim , "optimizer" : { "Adam" : { "learning_rate" : 0.001 } } , "loss" : { "MeanSquaredError" : { } } , "output_activation" : "linear" } if config is not None : config_ . update ( config ) network = dense . MLP ( config_ ) elif "tensor" in self . _state_type : raise NotImplementedError ( "Only supporting MLPs right now." ) else : raise ValueError ( "Unrecognized state type." ) return train . model_init ( network , config_ [ "loss" ] , config_ [ "optimizer" ] , batch_shape )
Configure and compile the action value network.
Configure and compile the action value network .
"""
        Configure and compile the action value network. For now, just an
        MLP, but CNNs will be supported soon.
        :return: Compiled TF Keras model
        """ # compiled model
Compiled TF Keras model
Compiled TF Keras model
self
config