modAL icon indicating copy to clipboard operation
modAL copied to clipboard

Can't reproduce ''keras_integration.py''

Open JustinElGG opened this issue 4 years ago • 4 comments

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

JustinElGG avatar Dec 18 '20 02:12 JustinElGG

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

cosmic-cortex avatar Jan 07 '21 10:01 cosmic-cortex

@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.

nightmare3000 avatar May 31 '21 13:05 nightmare3000

@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?

ayu1729 avatar Jul 21 '21 14:07 ayu1729

@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

nightmare3000 avatar Jul 21 '21 14:07 nightmare3000