nn_models/dense_q_model_v0.py
def create_network(self, input_size : int = 597, layers_list : List[int] = [600, 600, 600, 600]) -> None:
        '''
        This method creates network with a specific architecture
        :return:
        '''
        self.set_corrent_session()
        entries = Input(shape=(input_size,))

        for i, layer_size in enumerate(layers_list):
            print(layer_size)
            if i == 0:
                data_flow = Dense(layer_size, activation='relu')(entries)
            else:
                data_flow = Dense(layer_size, activation='relu')(data_flow)
        predictions = Dense(1, activation='tanh')(data_flow)

        optim = keras.optimizers.Adam(lr=0.001, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.0, amsgrad=False)
        self.network = Model(inputs=entries, outputs=predictions)
        self.network.compile(optimizer=optim, loss='mean_squared_error')

        with open('architecture.txt', 'w') as fh:
            # Pass the file handle in as a lambda function to make it callable
            self.network.summary(print_fn=lambda x: fh.write(x + '\n'))
        self.network.summary()
        self.session.run(tf.global_variables_initializer())

        This method creates network with a specific architecture
        :return:
        
This method creates network with a specific architecture
This method creates network with a specific architecture
def create_network(self, input_size : int = 597, layers_list : List[int] = [600, 600, 600, 600]) -> None:
        self.set_corrent_session()
        entries = Input(shape=(input_size,))
        for i, layer_size in enumerate(layers_list):
            print(layer_size)
            if i == 0:
                data_flow = Dense(layer_size, activation='relu')(entries)
            else:
                data_flow = Dense(layer_size, activation='relu')(data_flow)
        predictions = Dense(1, activation='tanh')(data_flow)
        optim = keras.optimizers.Adam(lr=0.001, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.0, amsgrad=False)
        self.network = Model(inputs=entries, outputs=predictions)
        self.network.compile(optimizer=optim, loss='mean_squared_error')
        with open('architecture.txt', 'w') as fh:
            self.network.summary(print_fn=lambda x: fh.write(x + '\n'))
        self.network.summary()
        self.session.run(tf.global_variables_initializer())
def create_network ( self , input_size : int = 597 , layers_list : List [ int ] = [ 600 , 600 , 600 , 600 ] ) -> None : self . set_corrent_session ( ) entries = Input ( shape = ( input_size , ) ) for i , layer_size in enumerate ( layers_list ) : print ( layer_size ) if i == 0 : data_flow = Dense ( layer_size , activation = 'relu' ) ( entries ) else : data_flow = Dense ( layer_size , activation = 'relu' ) ( data_flow ) predictions = Dense ( 1 , activation = 'tanh' ) ( data_flow ) optim = keras . optimizers . Adam ( lr = 0.001 , beta_1 = 0.9 , beta_2 = 0.999 , epsilon = None , decay = 0.0 , amsgrad = False ) self . network = Model ( inputs = entries , outputs = predictions ) self . network . compile ( optimizer = optim , loss = 'mean_squared_error' ) with open ( 'architecture.txt' , 'w' ) as fh : self . network . summary ( print_fn = lambda x : fh . write ( x + '\n' ) ) self . network . summary ( ) self . session . run ( tf . global_variables_initializer ( ) )
This method creates network with a specific architecture
This method creates network with a specific architecture
'''
        This method creates network with a specific architecture
        :return:
        ''' # Pass the file handle in as a lambda function to make it callable
None
self
input_size
int
layers_list
List[int]