8.6 KiB
8.6 KiB
Create ICs on Demand¶
In [1]:
import numpy as np
import matplotlib.pylab as plt
from models.multiresolution_flow_3d import *
from models.trainer import *
%matplotlib inline
Setup the model¶
In [2]:
nlevel=5
shape = (2**nlevel,2**nlevel,2**nlevel)
model = multi_scale_model(nlevel=nlevel)
tm = trainer(model)
test training with white noise¶
In [6]:
for i in np.arange(1000):
x_train = np.random.normal(0,0.01,shape)+3.1415
tm.train_single(x_train, silent=True)
tm.transfer(silent=False)
Out[6]:
In [7]:
x = model.generate()
print(np.mean(x[nlevel].flatten()),np.std(x[nlevel].flatten()))
plt.hist(x[nlevel].flatten(),bins=100)
plt.show()
In [ ]: