mirror of
https://github.com/wassname/ray.git
synced 2026-08-12 12:20:11 +08:00
[RLlib] Attention Net integration into ModelV2 and learning RL example. (#8371)
This commit is contained in:
@@ -80,9 +80,9 @@ For a full example of a custom model in code, see the `keras model example <http
|
||||
Recurrent Models
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
Instead of using the ``use_lstm: True`` option, it can be preferable use a custom recurrent model. This provides more control over postprocessing of the LSTM output and can also allow the use of multiple LSTM cells to process different portions of the input. For a RNN model it is preferred to subclass ``RecurrentTFModelV2`` to implement ``__init__()``, ``get_initial_state()``, and ``forward_rnn()``. You can check out the `custom_keras_rnn_model.py <https://github.com/ray-project/ray/blob/master/rllib/examples/custom_keras_rnn_model.py>`__ model as an example to implement your own model:
|
||||
Instead of using the ``use_lstm: True`` option, it can be preferable use a custom recurrent model. This provides more control over postprocessing of the LSTM output and can also allow the use of multiple LSTM cells to process different portions of the input. For an RNN model it is preferred to subclass ``RecurrentNetwork`` to implement ``__init__()``, ``get_initial_state()``, and ``forward_rnn()``. You can check out the `custom_rnn_model.py <https://github.com/ray-project/ray/blob/master/rllib/examples/custom_rnn_model.py>`__ model as an example to implement your own model:
|
||||
|
||||
.. autoclass:: ray.rllib.models.tf.recurrent_tf_modelv2.RecurrentTFModelV2
|
||||
.. autoclass:: ray.rllib.models.tf.recurrent_net.RecurrentNetwork
|
||||
|
||||
.. automethod:: __init__
|
||||
.. automethod:: forward_rnn
|
||||
|
||||
Reference in New Issue
Block a user