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
80 stars 4 forks source link

add from_hmm in circuit.py #254

Closed peppermin-t closed 2 months ago

loreloc commented 2 months ago

Hi Yinjia, a circuit that mimics an HMM should have DenseLayer as sum layers and HadamardLayer as product layers, so I think there is no need to specify sum and product factories in the from_hmm method. I believe you can remove them and add a dense_weight_factory to enable the user to optionally parameterize the dense layers differently. For example, see here: https://github.com/april-tools/cirkit/blob/main/cirkit/symbolic/circuit.py#L291

Thanks!

peppermin-t commented 2 months ago

from_hmm modified, sum and prod factory inputs removed. But I kept the input factory input, since I suggest that other input factories can also be useful here? (The Merge action above is my accidental click)