This week we completed the mixin and merged it into develop.

We also made train_machine_templated protected again by making the mixin base class a friend of subclasses.
Also, CWDSVMOcas is not the best candidate for string features since it actually asserts a particular feature type. So we had to get rid of the new changes there.
We added a unit tests for the dispatcher. The strategy is to make a fake machine that implements a templated train_machine. The model returns true if the feature type recieved from train call and the expected feature type. The expected type is set in the machine constructor.
It all worked out pretty well.
There are a few problems we saw like the fact that we will need a new mixin class for each feature class dispatching. There are a lot of feature classes so it does feel a bit redundant. Although it does make sense to keep diffrent feature types seperately too. We will think about this a bit more.
Another problem is when train_machine_templated is called with an illegal type parameter. Such an error will not be caught and this will cause problems in compiling downstream. A solution for this is using another type parameter in train_machine_templated. This defaults to a allowing only certain types like floating points. When we try to call train_machine_templated with something that is not allowed we can throw a ShogunException and avoid messy compiler errors.
On thinking about this a bit more we realized that we need to seperate arithmetic types from floating types. This means a new mixin class for arithmetic. The problem might just scale upwards as we introduce more feature dispatcher.

I also worked on a patch for cookbook in convolutional neural networks. This was a fun patch. First I created a dataset from images of 0, 1, 2 by reading them with opencv and writing them down in matrices. I used some default parameters along with creating two factory. neural_networks and neural_layer. Initially the network did not behave nicely becuase of misleading parameters. I will work with this in the next week.

Contributions

Feature type dispatching through recursive mixin
Neural Layers Cookbook