Can I have checkpoints in Bayesian optimization for tuning hyperparameters of a neural network?

Technical Source
2 min readApr 26, 2021

--

I’m trying to implement Bayesian Optimization on a BiLSTM network.

I’m planning to run this code in a university cluster but, they give us maximum of 2 days (48 hours) to run our job and if it goes beyond it, they automatically kill the job which probably will result in wasted time and resources for me and for other students waiting in que.

I was wondering if it would be possible to implement some kind of a checkpoint for bayesopt() to continue from where the job is left off:

Basically, what I’m asking is if I can save my previous runs (variables bayesopt() observed) and load them in my next run and continue from where it stopped?

I have not seen any documentation related to this (I may have missed it).

My understanding with bayesopt() is that, the more points are observed, the more accurate the answers bayesopt() gives. Is this right? If so, that means I might want to try to run it for more than 2 days maybe. The number of cores I can request are limited (the more I request, the longer I wait in que) and from what I’m estimating, the most complex combination of variables can take between 40 mins to 1 hour to train and give me a result ( obviously, not every combination will take this much time).

ANSWER

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

Currently, there is no checkpointing argument. However, you can use the ‘OutputFcn’ argument along with the ‘SaveFileName’ argument to save to file, and the resume function to restart the process as follows,

x1 = optimizableVariable('x1',[-5,5]);
x2 = optimizableVariable('x2',[-5,5]);
fun = @rosenbrocks;
if exist('BayesoptResults.mat','file')
load('BayesoptResults.mat');
results = resume(BayesoptResults,...
'SaveFileName', 'BayesoptResults.mat', ...
'OutputFcn',{@saveToFile});
else

SEE COMPLETE ANSWER CLICK THE LINK

https://www.matlabsolutions.com/resources/can-i-have-checkpoints-in-bayesian-optimization-for-tuning-hyperparameters-of-a-neural-network-.php

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet