rxnn 0.2.44__py3-none-any.whl → 0.2.45__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
rxnn/training/mrl.py CHANGED
@@ -91,6 +91,7 @@ class MrlTrajectoryEpisode(TypedDict):
91
91
  reset_stm: bool
92
92
  steps: list[MrlTrajectoryStep]
93
93
 
94
+ OptimField: TypeAlias = Literal['lr', 'critic_lr', 'weight_decay', 'critic_weight_decay', 'separate_memory_lr', 'memory_lr']
94
95
 
95
96
  class MRLTrainer:
96
97
  def __init__(
@@ -981,8 +982,19 @@ class MRLTrainer:
981
982
  self.reward = config.get('reward_model', self.shared_reward_model) # MRL Reward Model for curriculum stage
982
983
  self.update_epochs = config.get('update_epochs', self.shared_update_epochs) # Internal update epochs
983
984
  self.freeze_embeddings = config.get('freeze_embeddings', self.shared_freeze_embeddings)
984
- if config['lr'] is not None or config['critic_lr'] is not None or config['weight_decay'] is not None or config[
985
- 'critic_weight_decay'] is not None or (config['separate_memory_lr'] and config['memory_lr'] is not None):
985
+
986
+
987
+
988
+ def has_param(field: OptimField) -> bool:
989
+ return field in config and config[field] is not None
990
+
991
+ optim_params: list[OptimField] = ['lr', 'critic_lr', 'weight_decay', 'critic_weight_decay']
992
+
993
+ has_any_optim_param = any(
994
+ has_param(field) for field in optim_params
995
+ ) or (has_param('separate_memory_lr') and config['separate_memory_lr'] and has_param('memory_lr'))
996
+
997
+ if has_any_optim_param:
986
998
  if config.get('separate_memory_lr', False):
987
999
  self.optim_config = {
988
1000
  'lr': config.get('lr', self.base_optim_config['lr']),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: rxnn
3
- Version: 0.2.44
3
+ Version: 0.2.45
4
4
  Summary: RxNN: Reactive Neural Networks Platform
5
5
  License: Apache-2.0
6
6
  Keywords: deep-learning,ai,machine-learning
@@ -17,7 +17,7 @@ rxnn/training/callbacks.py,sha256=p72lbzFAmFjpcUvyy4aUB3qd53I8C6Sk5w9nQvsKgTk,35
17
17
  rxnn/training/dataset.py,sha256=7hTilFWPpqUEc6zNcMqBPjxFKxCfvTKKF3E8tVlwccQ,51250
18
18
  rxnn/training/ddp.py,sha256=VsNBjn3cY-uUj8hbsW7oKvb0_ZKnXnJ2KgObm-Mr9i4,836
19
19
  rxnn/training/models.py,sha256=tqABOt_xEcWbZNEW2I2Jt-3eyaGICK011zILwuTk6Zc,9082
20
- rxnn/training/mrl.py,sha256=BvrwqrIIyg_EmUA5p7c6UBcfFQ0ePIcl-EHEFQqyl2E,59472
20
+ rxnn/training/mrl.py,sha256=L4G7xSPlxsymvNhvsSloCpaqYjOXxEm7GmKilM_Ojvc,59809
21
21
  rxnn/training/reward.py,sha256=B7nerPk9eNAv2i7umtNF88tVQVwijNNrchIrEITGHKk,11623
22
22
  rxnn/training/rl.py,sha256=q4NzIZAmXRHVToT13IHrPTtEikWQUvT0NO0IjApjAO8,6171
23
23
  rxnn/training/scheduler.py,sha256=LcjU35mEwz2U5x3U6tLfeeYlBqMxbFSxYzJYuXkWbSY,1408
@@ -33,7 +33,7 @@ rxnn/transformers/moe.py,sha256=j6jEx6Ip0zttlUZKKn82azxo95lkLZs-H2GLSMD88hY,5859
33
33
  rxnn/transformers/positional.py,sha256=1PjcJybUzeQlIKJI4tahAGZcYgCRCL0otxs7mpsNuzM,4410
34
34
  rxnn/transformers/sampler.py,sha256=t6iiQTdLQ0TakUWnnhKkb5DKF2F_9-thXHBydDF3fxg,17389
35
35
  rxnn/utils.py,sha256=ihb6OTyDtPiocB_lOvnq7eOkjjpCkgs8wxvXUBNQ7mM,996
36
- rxnn-0.2.44.dist-info/LICENSE,sha256=C8coDFIUYuOcke4JLPwTqahQUCyXyGq6WOaigOkx8tY,11275
37
- rxnn-0.2.44.dist-info/METADATA,sha256=tW2Ve4whRK2LfCxix10dTLS5Dl_0C6KhcK8FsoKq-x0,25960
38
- rxnn-0.2.44.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
39
- rxnn-0.2.44.dist-info/RECORD,,
36
+ rxnn-0.2.45.dist-info/LICENSE,sha256=C8coDFIUYuOcke4JLPwTqahQUCyXyGq6WOaigOkx8tY,11275
37
+ rxnn-0.2.45.dist-info/METADATA,sha256=g8IqXAR2tXEyaNQOs--IPFFtSOnrWe4oouPK1PQBITw,25960
38
+ rxnn-0.2.45.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
39
+ rxnn-0.2.45.dist-info/RECORD,,
File without changes
File without changes