Skip to content

Commit 1c8a26b

Browse files
Proper use of setters in constructor
1 parent bec2380 commit 1c8a26b

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Manifold_Generation/MLP/Trainers_FGM/Trainers.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,24 @@ def __init__(self, Config_in:Config_FGM, group_idx:int=0):
108108
# Initiate parent class.
109109
PhysicsInformedTrainer.__init__(self)
110110
self.__Config = Config_in
111-
self._controlling_vars = DefaultProperties.controlling_variables
111+
self._controlling_vars = self.__Config.GetControllingVariables()
112112
self._train_vars = self.__Config.GetMLPOutputGroup(group_idx)
113113
self.callback_every = 10
114114
self._boundary_data_file = self.__Config.GetOutputDir()+"/"+DefaultProperties.boundary_file_header+"_full.csv"
115115

116116
# Synchronize settings with loaded configuration
117117
self._alpha_expo = self.__Config.GetAlphaExpo(group_idx)
118118
self._lr_decay = self.__Config.GetLRDecay(group_idx)
119-
self._batch_expo = self.__Config.GetBatchExpo(group_idx)
120-
self._activation_function = self.__Config.GetActivationFunction(group_idx)
119+
self.SetBatchExpo(self.__Config.GetBatchExpo(group_idx))
120+
self.SetActivationFunction(self.__Config.GetActivationFunction(group_idx))
121121
self.SetHiddenLayers(self.__Config.GetHiddenLayerArchitecture(group_idx))
122+
self.SetTrainVariables(self.__Config.GetMLPOutputGroup(group_idx))
123+
self.SetTrainFileHeader(self.__Config.GetOutputDir()+"/"+self.__Config.GetConcatenationFileHeader())
122124
self._train_name = "Group"+str(group_idx+1)
123125
self.SetTrainStepType("Jacobi")
124126
self._enable_boundary_loss=True
125127
self._boundary_loss_patience=-1
126-
128+
self.SetSaveDir(os.getcwd())
127129
self.SetInitializer("he_uniform")
128130

129131
return

0 commit comments

Comments
 (0)