continual-foragax 0.20.0__py3-none-any.whl → 0.20.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: continual-foragax
3
- Version: 0.20.0
3
+ Version: 0.20.1
4
4
  Summary: A continual reinforcement learning benchmark
5
5
  Author-email: Steven Tang <stang5@ualberta.ca>
6
6
  Requires-Python: >=3.8
@@ -1,6 +1,6 @@
1
1
  foragax/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  foragax/colors.py,sha256=rqNPiywP4Nvr0POhsGpasRk-nMMTS3DOwFRUgperlUk,2065
3
- foragax/env.py,sha256=APPu0r31A9SlvmJYkoZzsrh59YFVoLW3Rmyb3JT-dHw,20613
3
+ foragax/env.py,sha256=phGPMzwNKbwLLIyme1bjca3l2MLNKfYYBmly7JP8cLc,20498
4
4
  foragax/objects.py,sha256=iDFo_2CjpgErAm3QdQt5ixmQ8jdIvl7siIPqzGwVcGk,7665
5
5
  foragax/registry.py,sha256=5Ik61gIzTHc5A1_aOVbRXbVooRXz3GjmL7KdGsZTOTE,8642
6
6
  foragax/rendering.py,sha256=bms7wvBZTofoR-K-2QD2Ggeed7Viw8uwAEiEpEM3eSo,2768
@@ -128,8 +128,8 @@ foragax/data/ECA_non-blended_custom/TG_SOUID156887.txt,sha256=juzTPgJoJxfqmZkorL
128
128
  foragax/data/ECA_non-blended_custom/elements.txt,sha256=OtcUBoDAHxuln79BPKGu0tsQxG_5G2BfAX3Ck130kEA,4507
129
129
  foragax/data/ECA_non-blended_custom/metadata.txt,sha256=nudnmOCy5cPJfSXt_IjyX0S5-T7NkCZREICZSimqeqc,48260
130
130
  foragax/data/ECA_non-blended_custom/sources.txt,sha256=1j3lSmINAoCMqPqFrHfZJriOz6sTYZNOhXzUwvTLas0,20857
131
- continual_foragax-0.20.0.dist-info/METADATA,sha256=oTXP1c7cRZSnoUWUV6HvQb0FomwCpWnOtNrDp0M4u8I,4897
132
- continual_foragax-0.20.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
133
- continual_foragax-0.20.0.dist-info/entry_points.txt,sha256=Qiu6iE_XudrDO_bVAMeA435h4PO9ourt8huvSHiuMPc,41
134
- continual_foragax-0.20.0.dist-info/top_level.txt,sha256=-z3SDK6RfLIcLI24n8rdbeFzlVY3hunChzlu-v1Fncs,8
135
- continual_foragax-0.20.0.dist-info/RECORD,,
131
+ continual_foragax-0.20.1.dist-info/METADATA,sha256=UlkWfKTFOp5OPzmJ6ojc9I1aEtqCngdhNFcnX-WZ7gQ,4897
132
+ continual_foragax-0.20.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
133
+ continual_foragax-0.20.1.dist-info/entry_points.txt,sha256=Qiu6iE_XudrDO_bVAMeA435h4PO9ourt8huvSHiuMPc,41
134
+ continual_foragax-0.20.1.dist-info/top_level.txt,sha256=-z3SDK6RfLIcLI24n8rdbeFzlVY3hunChzlu-v1Fncs,8
135
+ continual_foragax-0.20.1.dist-info/RECORD,,
foragax/env.py CHANGED
@@ -361,19 +361,13 @@ class ForagaxEnv(environment.Environment):
361
361
  if self.nowrap:
362
362
  y_coords = jnp.clip(y_coords_original, 0, self.size[1] - 1)
363
363
  x_coords = jnp.clip(x_coords_original, 0, self.size[0] - 1)
364
- in_bounds = (
365
- (y_coords_original >= 0)
366
- & (y_coords_original < self.size[1])
367
- & (x_coords_original >= 0)
368
- & (x_coords_original < self.size[0])
369
- )
370
- original_colors = img[y_coords, x_coords]
364
+ # Create tint mask: any in-bounds original position maps to a cell makes it tinted
365
+ tint_mask = jnp.zeros((self.size[1], self.size[0]), dtype=int)
366
+ tint_mask = tint_mask.at[y_coords, x_coords].set(1)
367
+ # Apply tint to masked positions
368
+ original_colors = img
371
369
  tinted_colors = (1 - alpha) * original_colors + alpha * agent_color
372
- img = img.at[y_coords, x_coords].set(
373
- jnp.where(
374
- in_bounds[..., None], tinted_colors, img[y_coords, x_coords]
375
- )
376
- )
370
+ img = jnp.where(tint_mask[..., None], tinted_colors, img)
377
371
  else:
378
372
  y_coords = jnp.mod(y_coords_original, self.size[1])
379
373
  x_coords = jnp.mod(x_coords_original, self.size[0])