Skip to content

Release v0.4

Latest
Compare
Choose a tag to compare
@mayalenE mayalenE released this 30 Mar 18:03

👉 Corresponds to pypi release 0.4.1

New modules:

  • CustomGoalAchievementLoss: allow users to define custom loss_f functions and pass it to the constructor

Updated modules:

  • L2GoalAchievementLoss: now inherits from CustomGoalAchievementLoss
  • NearestNeighborInterventionSelector: now has a loss_f method (given in constructor) allowing custom distance function
  • BaseIM and IMFlowGoalGenerator have been updated to also allow custom distance_fn function
  • PushPerturbationGenerator: now the push is sampled on the hyper-rectangle of side magnitude

Updated util functions:

  • nearest_neighbors:
    • Y is now replaced by a vector called target
    • takes a loss_f function as input (allowing custom distance function)
    • distance is now computed by vmaping the loss_f function over X
  • is_stable: now check that the error |y(t)–yfinal| ≤ settling_threshold for all t in time_window (similar to matlab stepinfo function)

API changes:

  • in all pipeline, logs is now a DictTree that is created and saved in the pipeline, similar to history (removing dependencies to exputils package)

Bug Fixes:

  • IMFlowGoalGenerator IM_vals and IM_grads has been reincluded into the logs
  • PiecewiseSetConstantIntervention: removed hardplus when setting w and c
  • NoisePerturbationGenerator, PushPerturbationGenerator, WallPerturbationGenerator: perturbations are now scaled by trajectories_extent = jnp.nanmax(trajectories[.., 1:], -1) - jnp.nanmin(trajectories[..., 1:], -1) to avoid NaN values, don't take into account the position at t0 when scaling (often big jumps between t0 and t1), and when needed trajectories_extent is set to 1 (to avoid division by zero)

Tests: updated with the new changes

Examples: updated with the new changes