class_docstr: | `alias`: ``parl.Model``
  | `alias`: ``parl.core.paddle.agent.Model``
  
  | ``Model`` is a base class of PARL for the neural network. 
  A ``Model`` is usually a policy or Q-value function, which predicts 
  an action or an estimate according to the environmental observation.
  
  | To use the ``PaddlePaddle2.0`` backend model, user needs to call 
  ``super(Model, self).__init__()`` at the beginning of ``__init__`` 
  function.
  
  | ``Model`` supports duplicating a ``Model`` instance in a pythonic way:
  
  | ``copied_model = copy.deepcopy(model)``
  
  Example:
  
  .. code-block:: python
  
      import parl
      import paddle.nn as nn
  
      class Policy(parl.Model):
          def __init__(self):
              super(Policy, self).__init__()
              self.fc = nn.Linear(input_dim=100, output_dim=32)
  
          def policy(self, obs):
              out = self.fc(obs)
              return out
             
      policy = Policy() 
      copied_policy = copy.deepcopy(policy)
  
  Attributes:
      model_id(str): each model instance has its unique model_id.
  
  Public Functions:
      - ``sync_weights_to``: synchronize parameters of the current model 
      to another model.
      - ``get_weights``: return a list containing all the parameters of 
      the current model.
      - ``set_weights``: copy parameters from ``set_weights()`` to the model.
      - ``forward``: define the computations of a neural network. **Should** 
      be overridden by all subclasses.
class_docstr_tok: ["|","`","alias","`",":","``","parl.Model","``","|","`","alias","`",":","``","parl.core.paddle.agent.Model","``","|","``","Model","``","is","a","base","class","of","PARL","for","the","neural","network",".","A","``","Model","``","is","usually","a","policy","or","Q-value","function",",","which","predicts","an","action","or","an","estimate","according","to","the","environmental","observation",".","|","To","use","the","``","PaddlePaddle2.0","``","backend","model",",","user","needs","to","call","``","super","(","Model",",","self",")",".__init__","(",")","``","at","the","beginning","of","``","__init__","``","function",".","|","``","Model","``","supports","duplicating","a","``","Model","``","instance","in","a","pythonic","way",":","|","``","copied_model","=","copy.deepcopy","(","model",")","``","Example",":","..","code-block",":",":","python","import","parl","import","paddle.nn","as","nn","class","Policy","(","parl.Model",")",":","def","__init__","(","self",")",":","super","(","Policy",",","self",")",".__init__","(",")","self.fc","=","nn.Linear","(","input_dim=100",",","output_dim=32",")","def","policy","(","self",",","obs",")",":","out","=","self.fc","(","obs",")","return","out","policy","=","Policy","(",")","copied_policy","=","copy.deepcopy","(","policy",")","Attributes",":","model_id","(","str",")",":","each","model","instance","has","its","unique","model_id",".","Public","Functions",":","-","``","sync_weights_to","``",":","synchronize","parameters","of","the","current","model","to","another","model",".","-","``","get_weights","``",":","return","a","list","containing","all","the","parameters","of","the","current","model",".","-","``","set_weights","``",":","copy","parameters","from","``","set_weights","(",")","``","to","the","model",".","-","``","forward","``",":","define","the","computations","of","a","neural","network",".","*","*","Should","*","*","be","overridden","by","all","subclasses","."]
docstr: Returns a Python dict containing parameters of current model.
  
  Returns: 
      a Python dict containing the parameters of current model.
docstr_tok: ["Returns","a","Python","dict","containing","parameters","of","current","model",".","Returns",":","a","Python","dict","containing","the","parameters","of","current","model","."]
code: def get_weights(self):
      """Returns a Python dict containing parameters of current model.
  
      Returns:
          a Python dict containing the parameters of current model.
      """
      weights = self.state_dict()
      for key in weights.keys():
          weights[key] = weights[key].numpy()
      return weights
  
file_path: PARL/parl/core/paddle/model.py
imports: import paddle
  import paddle.nn
  import collections
  import numpy
  from parl.core.model_base import ModelBase
  from parl.utils import machine_info
label_desc: Use image node_id 3 for calling the Model obj's underlying member method code with example usage: obj.get_weights() and returns: weights