stulp / dmpbbo

Python/C++ library for Dynamical Movement Primitives and Black-Box Optimization
GNU Lesser General Public License v2.1
224 stars 90 forks source link

Implement UpdaterCovarAdaptation::setSubMatrices to mimic parallel optimization #59

Open stulp opened 2 years ago

stulp commented 2 years ago

The parallel optimization is no longer needed if the covariance matrix updates updates the matrix in submatrices. The simple solution to this would be to have a function UpdaterCovarAdaptation::setSubMatrices(VectorXi), in which the sizes of the submatrices are set, rather than derived from the array of distributions: https://github.com/stulp/dmpbbo/blob/ca900e3b851d25faaf59ea296650370c70ed7d0f/src/bbo/runOptimization.cpp#L112

The following functions can then be deleted: https://github.com/stulp/dmpbbo/blob/ca900e3b851d25faaf59ea296650370c70ed7d0f/src/dmp_bbo/runOptimizationTask.cpp#L227 https://github.com/stulp/dmpbbo/blob/ca900e3b851d25faaf59ea296650370c70ed7d0f/src/bbo/runOptimization.cpp#L65

stulp commented 2 years ago

See https://github.com/stulp/dmpbbo/issues/58#issuecomment-981143000 for backgroun information.

Current implementation

runOptimizationParallelDeprecated() has a list of N seperate distributions with MxM covariance matrices. They are each sampled separately, and the results concatenated into one NxM parameter vector.

Future (simpler implementation)

Have one NM x NM covariance matrix, but organize it in blocks.

Implementation Options:

pranshumalik14 commented 2 years ago

This notebook provides yet another way to have compact code following the current implementation.

stulp commented 2 years ago

Yes, very nice! See also my comments in #58