Open TiToLiOn opened 2 years ago
set_random_seed
sets the random seed, i.e., the random points will be same for running the same code multiple times. If you remove the for
loop, it would work. Otherwise, you can generate the points by yourself and pass via anchors
.
Hi Lu,
Thanks for the answer, but it remains giving me a diferent result. This is my code now:
dde.config.set_random_seed(666)
data = dde.data.TimePDE(geomtime, edp_difusion, [bc, ic], num_domain=62, num_boundary=62, num_initial=100, solution=sol, )
a1=data.train_points() a2=data.train_points()
figure() for x in a1: plot(x[0],x[1],color="red",marker="o")
figure()
for x in a2:
plot(x[0],x[1],color="red",marker="o"
)
I have a pair of questions.
Thanks for the help proffesor!
This is as expected. Consider the following pseudocode:
numpy.set_random_seed(0)
a = np.random()
b = np.random()
Should a
and b
be the same or not?
Hi Lu,
I've a problem while I was trying to finding best hyperparametres for my model. I wanted to hold the same training points for each net configuration, to obtain the same result if I decided to repeat the process in the future. For doing that, after setting a seed, I tried to obtain the same distribution of training points for each configuration, but I couldn't. The I decided to create a list of <deepxde.data.pde.TimePDE at 0x2680f9b72b0>, and I realise that, when I plot the training points, I got different results. I think that when I extract them with .train_points(), I got the same result in each column, but combined both columns with diferents order. Here is the part of my code I'm referring to. How could I solve that?
Thanks Lu!
capas=[4,5,6] neuronas=[16,32,64,128,256] N_int=[64,128,256,512] N_sb=[32,64,128] N_tb=[32,64,128]
opt=["adam","L-BFGS"]
lr=[0.001,0.01]
dde.config.set_random_seed(666)
datas=[] #ESTO LO HAGO PORQUE EL SET SEED NO ME FUNCIONA BIEN PARA EL SAMPLEO DE PUNTOS DE ENTRENAMIENTO for i in capas: for j in neuronas: for k in N_int: for l in N_sb: for m in N_tb: for n in lr: data = dde.data.TimePDE( geomtime, edp_difusion, [bc, ic], num_domain=k, num_boundary=l, num_initial=m, solution=sol, ) datas.append(data)
figure() for x in datas[0].train_points(): plot(x[0],x[1],color="red",marker="o")
figure() for x in datas[0].train_points(): plot(x[0],x[1],color="red",marker="o")