Commit f6128c29 authored by s.gretchko's avatar s.gretchko
Browse files

Added random generator seed parameter

parent 819b7f37
......@@ -18,6 +18,6 @@ warmupParams = {
'anim': 0
}
Pty = PtychographyExperiment(debug = False, warmup = True, MAXIT=10, warmup_params=warmupParams)
Pty = PtychographyExperiment(warmup=True, MAXIT=10, warmup_params=warmupParams)
Pty.run()
Pty.show()
......@@ -110,6 +110,7 @@ class Experiment(metaclass=ExperimentMetaClass):
save_output=False,
json_output=True,
matlab_output=True,
rnd_seed = 1234,
**kwargs):
"""
......@@ -142,8 +143,6 @@ class Experiment(metaclass=ExperimentMetaClass):
self.desired_Ny = Ny
self.desired_Nz = Nz
# self.dim = dim #TODO maybe not needed ?
self.noise = noise
self.data_ball = data_ball
self.diagnostic = diagnostic
......@@ -173,8 +172,11 @@ class Experiment(metaclass=ExperimentMetaClass):
self.accelerator_name = accelerator_name
self.rotate = rotate # tells the iterate monitor to rotate the iterates
# to a fixed global reference
# to a fixed global reference
self.rnd_seed = rnd_seed
# additional attributes
self.data = None
self.data_sq = None
self.norm_data = None
......@@ -193,7 +195,8 @@ class Experiment(metaclass=ExperimentMetaClass):
self.productProxOperators = []
self.n_product_Prox = None # size of the product space
# TODO: which default: None, 0 or 1 ? see how it is used
# TODO: which default: None, 0 or 1 ?
# see how it is used
self.propagator = None
self.inverse_propagator = None
......@@ -214,6 +217,8 @@ class Experiment(metaclass=ExperimentMetaClass):
this experiment.
"""
np.random.seed(self.rnd_seed) # set random generator seed
# load data
self.loadData()
self.reshapeData(self.Nx, self.Ny, self.Nz) # TODO need to revisit this
......
......@@ -71,8 +71,6 @@ class CDI_Experiment(PhaseExperiment):
Load CDI dataset. Create the initial iterate.
"""
np.random.seed(1234) # for tests
# make sure input data can be found, otherwise download it
GetData.getData('Phase')
......
......@@ -71,9 +71,7 @@ class Krueger_Experiment(PhaseExperiment):
"""
Load Krueger dataset. Create the initial iterate.
"""
np.random.seed(1234) # for tests
#make sure input data can be found, otherwise download it
GetData.getData('Phase')
......
......@@ -164,7 +164,6 @@ class PtychographyExperiment(Experiment):
"""
Load Ptychography dataset. Create the initial iterate.
"""
np.random.seed(1234) # for tests
#make sure input data can be found, otherwise download it
GetData.getData('Ptychography')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment