Excessive (?) memory occupation during hyperparameter tuning with Tensorflow & Keras

During the holidays, I've been happily playing with keras & tensorflow in RStudio Cloud, on the UCI wine quality dataset. I defined a worfklow, where I download & preprocess the data, then I fit multiple models in order to tune the numerous hyperparameters: a README.md file has been provided so that you can easily rerun the analysis.

The dataset is very small ( ~500 kB), the task is relatively simple (classify the wine quality to one of 4 classes , according to the 11 features), and each model is very small, by modern standards (1 hidden layer, max ~5000 parameters). I try to fit ~400 models, however, I've not been able to fit all of them, not even once. Discussing on the RStudio Cloud channel, it seems to be a memory issue:

However, RStudio Cloud provides 1 GB of RAM, each model is very small, and AFAIU, Tensorflow is not growing the computational graph abnormally (each model is fit in a new graph, so the graph size doesn't keep growing). So, why do Tensorflow & Keras grow their memory occupation so much? Am I doing something wrong? Can you help me fix this? Thanks in advance

FYI, the project doesn't seem to have public access, so no one else can look at it.

Whoops! Thanks @mara! I made the original project public, but I forgot to make this "copy" public too. It should be fixed now! BTW, you just made me realize that RStudio Cloud is by far the best way to run R on mobile :grin: