archive/embedding_average_pool/embedding_average_pool_v0.py
def create_network(self, input_size : int = 498, layers_list : List[int] = [800, 800, 800, 800]) -> None:
        '''
        This method creates network with a specific architecture
        :return:
        '''

        #board input:
        gems_on_board_input = Input(shape=(36,), name='gems_on_board')
        cards_on_board_input_list = [Input(shape=(51,), name='card_{}th'.format(i)) for i in range(12)]
        nobles_on_board_list = [Input(shape=(25,), name='noble_{}th'.format(i)) for i in range(3)]

        #active_player:
        active_player_discount = Input(shape=(80,), name='active_player_discount')
        active_player_gems = Input(shape=(36,0), name='active_player_gems')
        active_player_reserved_cards = [Input(shape=(51,0), name='active_rsv_card_{}th'.format(i)) for i in range(3)]
        active_player_points = Input(shape = (25,), name='active_player_points')

        #TODO: klasa model  card_encoder
        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)
                #data_flow = Dropout(rate=0.1)(data_flow)
        predictions = Dense(1, activation='tanh')(data_flow)

        self.params['Layers list'] = layers_list

        lr = 0.001
        beta_1 = 0.9
        beta_2 = 0.999
        epsilon = None
        decay=0.0
        amsgrad = False

        optim = keras.optimizers.Adam(lr=lr, beta_1=beta_1, beta_2=beta_2, epsilon=epsilon, decay=decay, amsgrad=amsgrad)
        self.params['optimizer_name'] = 'Adam'
        self.params['optimizer lr'] = lr
        self.params['optimizer beta_1'] = beta_1
        self.params['optimizer beta_2'] = beta_2
        self.params['optimizer epsilon'] = None
        self.params['optimizer decay'] = 0.0
        self.params['optimizer amsgrad'] = False


        self.network = Model(inputs=entries, outputs=predictions)
        self.network.compile(optimizer=optim, loss='mean_squared_error')
        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 = 498, layers_list : List[int] = [800, 800, 800, 800]) -> None:
        gems_on_board_input = Input(shape=(36,), name='gems_on_board')
        cards_on_board_input_list = [Input(shape=(51,), name='card_{}th'.format(i)) for i in range(12)]
        nobles_on_board_list = [Input(shape=(25,), name='noble_{}th'.format(i)) for i in range(3)]
        active_player_discount = Input(shape=(80,), name='active_player_discount')
        active_player_gems = Input(shape=(36,0), name='active_player_gems')
        active_player_reserved_cards = [Input(shape=(51,0), name='active_rsv_card_{}th'.format(i)) for i in range(3)]
        active_player_points = Input(shape = (25,), name='active_player_points')
        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)
        self.params['Layers list'] = layers_list
        lr = 0.001
        beta_1 = 0.9
        beta_2 = 0.999
        epsilon = None
        decay=0.0
        amsgrad = False
        optim = keras.optimizers.Adam(lr=lr, beta_1=beta_1, beta_2=beta_2, epsilon=epsilon, decay=decay, amsgrad=amsgrad)
        self.params['optimizer_name'] = 'Adam'
        self.params['optimizer lr'] = lr
        self.params['optimizer beta_1'] = beta_1
        self.params['optimizer beta_2'] = beta_2
        self.params['optimizer epsilon'] = None
        self.params['optimizer decay'] = 0.0
        self.params['optimizer amsgrad'] = False
        self.network = Model(inputs=entries, outputs=predictions)
        self.network.compile(optimizer=optim, loss='mean_squared_error')
        self.session.run(tf.global_variables_initializer())
def create_network ( self , input_size : int = 498 , layers_list : List [ int ] = [ 800 , 800 , 800 , 800 ] ) -> None : gems_on_board_input = Input ( shape = ( 36 , ) , name = 'gems_on_board' ) cards_on_board_input_list = [ Input ( shape = ( 51 , ) , name = 'card_{}th' . format ( i ) ) for i in range ( 12 ) ] nobles_on_board_list = [ Input ( shape = ( 25 , ) , name = 'noble_{}th' . format ( i ) ) for i in range ( 3 ) ] active_player_discount = Input ( shape = ( 80 , ) , name = 'active_player_discount' ) active_player_gems = Input ( shape = ( 36 , 0 ) , name = 'active_player_gems' ) active_player_reserved_cards = [ Input ( shape = ( 51 , 0 ) , name = 'active_rsv_card_{}th' . format ( i ) ) for i in range ( 3 ) ] active_player_points = Input ( shape = ( 25 , ) , name = 'active_player_points' ) 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 ) self . params [ 'Layers list' ] = layers_list lr = 0.001 beta_1 = 0.9 beta_2 = 0.999 epsilon = None decay = 0.0 amsgrad = False optim = keras . optimizers . Adam ( lr = lr , beta_1 = beta_1 , beta_2 = beta_2 , epsilon = epsilon , decay = decay , amsgrad = amsgrad ) self . params [ 'optimizer_name' ] = 'Adam' self . params [ 'optimizer lr' ] = lr self . params [ 'optimizer beta_1' ] = beta_1 self . params [ 'optimizer beta_2' ] = beta_2 self . params [ 'optimizer epsilon' ] = None self . params [ 'optimizer decay' ] = 0.0 self . params [ 'optimizer amsgrad' ] = False self . network = Model ( inputs = entries , outputs = predictions ) self . network . compile ( optimizer = optim , loss = 'mean_squared_error' ) 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:
        ''' #board input: #active_player: #TODO: klasa model  card_encoder #data_flow = Dropout(rate=0.1)(data_flow)
None
self
input_size
int
layers_list
List[int]