Keras Tuner and max model Size

Hello mentors and readers,

I am trying to restraint my model size to a certain max number of parameter.
For exemple, let’s say I have a Neural net with 5 inputs, and max number of parameter 256.
I tried the argument max_model_size in a tuner , but I feel it is not working at all, as the tuner returns too big models for my application.
And of course, google the issue leads to an open GitHub thread :

Can someone help me with restraining keras tuner to a certain model size ?
Thanks,
Maxime

Set keras_tuner.engine.tuner.MAX_FAIL_STREAK to a really high number to increase the number of before calling tuner.search. This way, the tuner will continue to look for an architecture that satisfies your constraints.

One way to determine MAX_FAIL_STREAK is to use the number of combinations of hyperparameters the tuner has to evaluate to pick the best model.