modAL-python / modAL

A modular active learning framework for Python
https://modAL-python.github.io/
MIT License
2.24k stars 324 forks source link

Is it possible to work with CNNs and images without flatten data? #5

Closed dhaalves closed 6 years ago

dhaalves commented 6 years ago

I see ActiveLearner expects a 2d array for x_training, What if I want to train a keras CNN (Resnet, Inception, etc) on cifar10 (32,32,3) for example. Is it possible?

cosmic-cortex commented 6 years ago

Not right now, because I call sklearn.utils.check_array with ensure_2d=True. Good point though, these checks should be left to the estimator objects, a Keras model in this case. I'll fix this ASAP and merge it to the master branch soon!

dhaalves commented 6 years ago

Awesome. Thanks for the quick reply

cosmic-cortex commented 6 years ago

I have removed calls to sklearn.utils.check_array, so now you can work with images without reshaping. Will change this Keras integration example accordingly to use CNNs.

cosmic-cortex commented 6 years ago

Ok, now everything is fixed and tested. Image data no longer needs to be reshaped, as demonstrated in this example.

dhaalves commented 6 years ago

Thanks. I will try it later.