Skip to content

Commit f5740ad

Browse files
chore: drop time feature from embedding
- it's a weird env-specific piece of state that the model can exploit to do things like only solve at the end to try and game rewards. BREAKING CHANGE: this removes a model feature that makes previous pretrained models incompatible
1 parent 10bfff2 commit f5740ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libraries/mathy_python/mathy/agents/embedding.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ def __init__(self, config: BaseConfig, **kwargs):
2323
mask_zero=True,
2424
)
2525
# +1 for the value
26-
# +1 for the time
26+
# +1 for the time - removed for ablation
2727
# +2 for the problem type hashes
28-
self.concat_size = 4
28+
self.concat_size = 3
2929
self.values_dense = tf.keras.layers.Dense(self.config.units, name="values_input")
30-
self.time_dense = tf.keras.layers.Dense(self.config.units, name="time_input")
30+
# self.time_dense = tf.keras.layers.Dense(self.config.units, name="time_input")
3131
self.type_dense = tf.keras.layers.Dense(self.config.units, name="type_input")
3232
self.in_dense = tf.keras.layers.Dense(
3333
self.config.units,
@@ -74,7 +74,7 @@ def call(self, features: MathyInputsType, train: tf.Tensor = None) -> tf.Tensor:
7474
tf.expand_dims(features[ObservationFeatureIndices.values], axis=-1)
7575
),
7676
self.type_dense(features[ObservationFeatureIndices.type]),
77-
self.time_dense(features[ObservationFeatureIndices.time]),
77+
# self.time_dense(features[ObservationFeatureIndices.time]),
7878
],
7979
axis=-1,
8080
name="input_vectors",

0 commit comments

Comments
 (0)