Skip to content

comment: code complexity somewhat overwhelming #3671

Closed
@jstrong-tios

Description

@jstrong-tios

this is not a bug, and feel free to immediately close this issue. I cloned pymc3 in an effort to understand how HMC/NUTS sampling works. What I found was in order to understand how the NUTS class works, I would need to understand:

  • an involved class hierarchy (BlockedStep > GradientSharedStep > BaseHMC > NUTS)
  • the Model class that inherits from three other classes in addition to a custom metaclass (class Model(Context, Factor, WithMemoization, metaclass=InitContextMeta):)
  • Point - an object-creating function with capitalized name (expected class Point, searching initially failed)
  • QuadPotential > QuadPotentialDiagAdapt
  • CpuLeapFrogIntegrator
  • ArrayOrdering, DictToArrayBijection
  • IntEnum > Competence (also unique class decorator)
  • bonus: rare try/except/else usage

Needless to say, it was a bit overwhelming. I'm not complaining about it, or urging you to "fix" it. This is just an anecdotal aside about what it's like for someone coming at pymc3 fresh to try to dive into the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions