modAL-python / modAL

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

Can't reproduce ''keras_integration.py'' #116

Open JustinElGG opened 3 years ago

JustinElGG commented 3 years ago

recently I'm trying to run the example code for Keras(''keras_integration.py''), but the actual amount of training data is far less than the amount of input data I set. For example, I use 1000 samples to initialize the learner, but only 32 samples is being trained. Anyone also have problem with the example code? image

cosmic-cortex commented 3 years ago

Hi! Strange, for me, it works perfectly. I don't have any ideas what is going on.

nightmare3000 commented 3 years ago

@JustinElGG Keras shows the number of batches that are trained, not the number of samples. When no batching is specified in the input pipeline Keras automatically creates batches of 32 samples. Since you have 1000 training samples 1000 / 32 = 31,25 batches are created. Since 0.25 batches are not possible this results in 32 batches of which 31 have a full size of 32 samples and 1 batch with only 8 samples.

ayu1729 commented 3 years ago

@JustinElGG Keras shows the number of batches that are trained, not the number of samples. When no batching is specified in the input pipeline Keras automatically creates batches of 32 samples. Since you have 1000 training samples 1000 / 32 = 31,25 batches are created. Since 0.25 batches are not possible this results in 32 batches of which 31 have a full size of 32 samples and 1 batch with only 8 samples.

It is showing an accuracy of 0.1150 ,should it be the case?

nightmare3000 commented 3 years ago

@JustinElGG Keras shows the number of batches that are trained, not the number of samples. When no batching is specified in the input pipeline Keras automatically creates batches of 32 samples. Since you have 1000 training samples 1000 / 32 = 31,25 batches are created. Since 0.25 batches are not possible this results in 32 batches of which 31 have a full size of 32 samples and 1 batch with only 8 samples.

It is showing an accuracy of 0.1150 ,should it be the case?

If it is the first epoch for the model an accuracy of 11.5% is possible