Learning rate scheduling for Variational Inference

Hi Jesse,

I’ve got some time again to try and get this done :slight_smile:

I’m getting the following error when trying the print ops: ValueError: Length of DropDims{axis=0}.0 cannot be determined.

There’s a typo in my code :frowning:

pytensor.printing.Print creates an Op class instance that you then need to pass item into. The class initializer has a single argument, the name of the object being printed. So the correct syntax is:

loss_or_grads = [pytensor.printing.Print(f'loss_item_{i}')(item) for i, item in enumerate(loss_or_grads)]

Ahh, sorry didn’t notice.

I’ve actually tried using a callback—rather than wrapping the optimiser—and got things working. I kind of like using a callback better, probably because I’m used to keras. Shall I open a PR and move the discussion there?

1 Like

Yea sounds great, just tag me on the PR

Opened an issue: ENH: Implement learning rate scheduling for variational inference · Issue #7010 · pymc-devs/pymc · GitHub

1 Like