jacobpennington / nems-lite

WIP refactor of lbhb/NEMS and lbhb/nems_db
GNU General Public License v3.0
1 stars 1 forks source link

MultiModel class (maybe not that name) #24

Open jacobpennington opened 2 years ago

jacobpennington commented 2 years ago

General idea would be to provide a simple wrapper class for composing Models similar to the way a Model composes Layers. This would not provide new functionality, it would just be a way to make Layer grouping explicit for complex Models. I think this would be fairly straightforward to implement. This could also make separate fitting of Layer groups more intuitive.

Ex: split LN into two models

linear_nonlinear = MultiModel(
    Model(WeightChannels(...), FIR(...)),  # Linear part
    Model(DoubleExponential(...))          # Nonlinear part
)

Ex: model with multiple "branches"

branched_model = MultiModel(
    [Model(WeightChannels(...), FIR(...)), Model(WeightChannels(...), StateGain(...))],
    Model(WeightedSum(...), DoubleExponential(...))
)