april-tools / cirkit

a python framework to build, learn and reason about probabilistic circuits and tensor networks
https://cirkit-docs.readthedocs.io/en/latest/
GNU General Public License v3.0
71 stars 1 forks source link

Refactor parameter initialization #143

Closed lkct closed 3 months ago

lkct commented 11 months ago

With reparam class added, the params do not necessarily mean the same as before, and the way to initialize them may need to be changed.

Therefore we need to double-check what exists in the repo (e.g. reset_parameters) and refactor those if needed.

lkct commented 11 months ago

NOTE: some Layers can have children Modules or Parameters which might or might not be initialized by themselves.

We need to double-check what exactly it resets in reset_parameters and how reset is called in __init__. We need to design whether a layer inits/resets its direct parameters or all children. We also need to check how this interacts with Reparameterization , which is also a Module

loreloc commented 4 months ago

This will be solved by adding symbolic initializer: only the user who is aware of the parameterization is capable of specifying a suitable initialization.