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 reparam and layer reset_param #211

Closed lkct closed 8 months ago

lkct commented 8 months ago

As per title. Closes #184.

Main idea: Initialization becomes an optional component of materialization, and BinaryReparam does not propagate "materialization and initialization", which prevents overwriting existing params. This requires that the tensorized product circuit should not be constructed before the two inputs are tensorized. For simple reparams used for plain circuits, there's still a "reasonable" default for all layer params, so that starting users won't need to care about the details.