Skip to content

Conversation

@casperlchristensen
Copy link
Collaborator

@casperlchristensen casperlchristensen commented Dec 3, 2025

Note

Introduce a unified FactoredGenerativeProcess with pluggable conditional structures and builders, plus utilities and extensive tests/configs.

  • Generative Processes:
    • Add FactoredGenerativeProcess supporting composite vocabularies and per-factor state transitions.
    • Implement observation/log-probability, emission, and transition updates via encoder-based factorization.
  • Conditional Structures (simplexity/generative_processes/structures):
    • New protocols and implementations: IndependentStructure, SequentialConditional, FullyConditional, ConditionalTransitions.
    • Provide variant selection and joint distribution computation for each structure.
  • Builder Enhancements (builder.py):
    • Add build_factored_process and build_factored_process_from_spec factories.
    • Add helpers: build_matrices_from_spec, build_chain_from_spec, build_symmetric_from_spec, build_transition_coupled_from_spec.
    • Minor: return HiddenMarkovModel without device arg in nonergodic builder.
  • Utilities (utils/factoring_utils.py):
    • Add compute_obs_dist_for_variant, transition_with_obs, and TokenEncoder for factor encoding/updates.
  • GHMM:
    • Strengthen validate_transition_matrices with eigenvalue check and normalization warning.
  • Tests & Examples:
    • Add comprehensive unit/integration tests for builders, structures, factored process, and utils.
    • Add end-to-end YAML configs demonstrating independent, chain, symmetric, and transition_coupled structures.
    • Update analysis and structured-config tests to use jax.Array types.

Written by Cursor Bugbot for commit eac6194. This will update automatically on new commits. Configure here.

@casperlchristensen casperlchristensen marked this pull request as draft December 3, 2025 15:22
@casperlchristensen casperlchristensen marked this pull request as ready for review December 3, 2025 16:51
casperlchristensen and others added 10 commits December 3, 2025 09:21
Previous code extracted values from JAX arrays and convert to Python ints at runtime. This will fail when the function is JIT-compiled because JAX arrays become tracers during compilation, and int() on a tracer raises an error. The vocab_sizes parameter must be provided to __init__ for this method to work with JIT.
…reating factored process configurations. Added parameterized tests for valid and invalid configurations, improving test coverage and maintainability.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants