function gen_module(ss,tnum)
%addpath('..\..\..\Methods\FunAppr\MLPotts_LMCodeKay');
%addpath('..\..\..\Methods\FunAppr\LMMLP');
str=['load data\' ss '.txt;'];eval(str);
%load 'data\a1.txt';
str=['a=' ss ';'];eval(str);
%a=a1;
plot_curve(a);
L=5;
[x,yy]=form_pairs(a./(ones(size(a,1),1)*max(a)),L);
train_x=x;
y=yy(1,:)';
train_y=y;
[E1,NetDef1,W11,W12]=noisecan(train_x,train_y,20);
Net1.NetDef=NetDef1; Net1.W1=W11; Net1.W2=W12; 
train_x=x;
y=yy(2,:)';
train_y=y;
[E1,NetDef2,W21,W22]=noisecan(train_x,train_y,20);
Net2.NetDef=NetDef2; Net2.W1=W21; Net2.W2=W22;
%x: Nxd  y:1xN
    %x_test: Nxd y_test: 1xN
   % x_test=x;y_test=y;
   % LM_MLPotts;Net1=Net;plot_MLPotts(Net);
   % y=yy(2,:);y_test=y;
   % LM_MLPotts;Net2=Net;plot_MLPotts(Net);
   
   str=['save ' 'module' num2str(tnum) '.mat' ' Net1 Net2 L']; 
   eval(str);
return

