Memo/Matlab

Matlab : Prepare the Machine Learning Param Table

_Ju 2022. 11. 12. 22:15

Yeah.

 


#Code

Param_A_Set = 1:1:10;
Param_B_Set = 100:5:500;
Param_C_Set = 0.1:0.1:0.9;
Param_D_Set = 0.1:0.1:0.9;

[A, B, C, D] = ndgrid(Param_A_Set, Param_B_Set, Param_C_Set, Param_D_Set);
ParamsPairs_Set = [A(:) B(:) C(:) D(:)]; clear A B C D;
ParamsPairs_Size = size(ParamsPairs_Set, 1);
ParamsPairs_Result = zeros(ParamsPairs_Set, 1);

ParamsPairs_Cur_Index = 0;
ParamsPairs_Cur_Set = 0;



// Find Random ParamsPairs Set
[index] = find(ParamsPairs_Result == 0);
if (~isempty(index))
	temp = randi([1 length(index)]);
    ParamsPairs_Cur_Index = index(temp);
    ParamsPairs_Cur_Set = ParamsPairs_Set(ParamsPairs_Cur_Index);
else
	disp('Task Completed..')
end