Added bounds_vector function in nems/fitters/mappers, which
returns a function that maps bounds dictionaries (with a structure
similar to phi) to a flattened vector for use by coordinate
descent and scipy_minimize fitters.
Incorporated bounds function into fit_basic and fit_iteratively,
as well as coordinate_descent and scipy_minimize.
Fixed a minor bug in distributions/exponential.py
As an aside, the bounds are set up to be perfectly happy with entire modelspecs
or parts of modelspecs that don't define bounds, or even defining bounds for one
parameter but not others. So this shouldn't create a need to start adding blank
bounds into all of our keywords - only the ones that need them.
Per the example in the docstring for bounds_vector, bounds can be defined in
the modelspec in a manner similar to phi:
{'fn': 'some.module', 'phi': {'p1': 1.0, 'p2': 2.0}, 'bounds': {'p1': (-3.0, 3.0), 'p2': (0.0, None)}}
Added bounds_vector function in nems/fitters/mappers, which returns a function that maps bounds dictionaries (with a structure similar to phi) to a flattened vector for use by coordinate descent and scipy_minimize fitters.
Incorporated bounds function into fit_basic and fit_iteratively, as well as coordinate_descent and scipy_minimize.
Fixed a minor bug in distributions/exponential.py
As an aside, the bounds are set up to be perfectly happy with entire modelspecs or parts of modelspecs that don't define bounds, or even defining bounds for one parameter but not others. So this shouldn't create a need to start adding blank bounds into all of our keywords - only the ones that need them.
Per the example in the docstring for bounds_vector, bounds can be defined in the modelspec in a manner similar to phi: {'fn': 'some.module', 'phi': {'p1': 1.0, 'p2': 2.0}, 'bounds': {'p1': (-3.0, 3.0), 'p2': (0.0, None)}}