mirror of
https://github.com/wassname/ray.git
synced 2026-10-02 12:41:04 +08:00
[RLlib] Attention Net integration into ModelV2 and learning RL example. (#8371)
This commit is contained in:
1 parent
9347a5d10c
commit
796a834c48
44 files changed
+1279
-911
No files matched your search
@@ -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