Repository navigation
test: Add Valley-Bowl, optimizer and LR options to trajectories - #843
rkhosrowshahi wants to merge 6 commits into
Conversation
Add the Valley-Bowl toy problem from CAGrad and Nash-MTL as the VB and VB01 objectives, and add --optimizer and --lr flags to optimize.py.
a6a0509 to
57aacaf
Compare
ValerianRey
left a comment
There was a problem hiding this comment.
I didn't review the maths, I trust you on that. I have a concern about how we represent the mean objective, but apart from that LGTM.
| @property | ||
| def optimum(self) -> Tensor: | ||
| """ | ||
| Pareto-optimal point that (approximately) minimizes the mean of the unscaled objectives. It | ||
| does not depend on ``scale`` or ``scale_both_losses``. | ||
| """ | ||
| return torch.tensor([0.0, self.PARETO_SET_X2]) |
There was a problem hiding this comment.
I'm not a fan of calling this "optimum" and emphasizing it too much as the natural objective of the optimization problem. This is just an arbitrary choice of target. Maybe we could call it mean_optimum or something like that.
Also, I'm not a fan of representing this point / its image, as a star on the plot. The star is for the pareto set / front, when it consists of a single point (as in the EWQ objective).
This would also give the idea that not converging to the star is a bad thing, while in reality converging to the star is an arbitrary choice, that some aggregators make and some don't.
Make the subplots slightly wider than tall (box aspect 5/6), so that matplotlib's automatic ticks on the x-axis are as complete as on the y-axis instead of skipping values.
d6ef312 to
ce81897
Compare



Adds the two-objective Valley-Bowl toy problem from CAGrad (Liu et al., 2021), also used by Nash-MTL (Navon et al., 2022), to the trajectory experiments, and lets
optimize.pychoose the optimizer and override the learning rate.Reference implementations:
CAGrad:
toy.pyNash-MTL:
experiments/toyNew
ValleyBowlobjective with its reference Pareto set, registered asVBandVB01(first objective scaled by 0.1) in_constants.py, to compare aggregators under loss rescaling. Itsscaleandscale_both_lossesparameters follow the Nash-MTL implementation.optimize.py: new--optimizer {sgd,adam}(defaultsgd) and--lrflags; the optimizer is saved inmetadata.json.plot_params.py/plot_values.py: Valley-Bowl-specific heatmaps, Pareto set/front and optimum marker.Typed
AGGREGATORSasdict[str, Aggregator].Learning rate. Both Valley-Bowl variants use a base learning rate of 0.001 for SGD and Adam. Each trajectory is deterministic for a given starting point. A large step can jump over a valley or push the trajectory far outside the plotting window. A small, fixed rate keeps the comparison focused on the direction each aggregator chooses toward the Pareto set from each starting point. It also matches the runs we already have with both optimizers. Per-aggregator multipliers still apply on top of this, unless
--lris given.Initial points. There are 5 starting points. Three of them, (0, 0), (-7.5, -0.5) and (9, -1), lie near the boundary between the valleys and the bowls. The other two, (-8.5, 7.5) and (9, 9), start high up in the valleys, which makes them harder to optimize from.
Usage: