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

add from_hmm in circuit.py #254

Closed peppermin-t closed 1 month ago

loreloc commented 1 month 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 1 month 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)