Optimize ESN Hyperparameters with Grid Search MATLAB
이전 댓글 표시
I have the following echo state state network (ESN) hyperparameters: m_GS,k_GS,c_GS,gamma_GS. I would like to use my ESN to find the optimal values for these four hyperparameters using the grid search method in MATLAB. The function I would like to minimize is the discrete time vector L2_loss(m), where M=101 is the number of simulation timesteps in the function for m=1,2,...,M. Hence, L2_loss is a 1 by 101 double vector in my case. My attempt is shown below:
% Grid Search
ndatapoints = 20;
m_GS = linspace(0,1,ndatapoints); % [kg]
k_GS = linspace(0,100,ndatapoints); % [N/m]
c_GS = linspace(0,100,ndatapoints); % [kg/s]
gamma_GS = linspace(100,200,ndatapoints); % [N/m^3]
[m_G,k_G,c_G,gamma_G] = ndgrid(m_GS,k_GS,c_GS,gamma_GS);
fitresult = L2_loss;
[minval, minidx] = min(fitresult);
m_GS_optimal = m_G(minidx);
k_GS_opitimal = k_G(minidx);
c_GS_optimal = c_G(minidx);
gamma_GS_optimal = gamma_G(minidx);
I'm not sure that this is correct as c_GS_optimal and k_GS_optimal are both zero. Do I need to increase ndatapoints or set it equal to m?
댓글 수: 3
Jonathan Frutschy
2024년 4월 25일
편집: Jonathan Frutschy
2024년 4월 25일
Jonathan Frutschy
2024년 4월 25일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Get Started with Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!