(name, field_dims)
name: the name of the target model
    field_dims: the dimensions of fields
name: the name of the target model
    field_dims: the dimensions of fields
name : the name of the target model field_dims : the dimensions of fields
def get_model(name, field_dims):
    """
    name: the name of the target model
    field_dims: the dimensions of fields
    """
    if name == 'nfm':
        return NeuralFactorizationMachineModel(field_dims, embed_dim=16, mlp_dims=(64,), dropouts=(0.2, 0.2))
    elif name == 'hen':
        return HENModel(field_dims, embed_dim=16, sequence_length=11, lstm_dims=20,
                        mlp_dims=(64,),
                        dropouts=(0.2, 0.2))
    elif name == 'wd':
        return WideAndDeepModel(field_dims, embed_dim=16, mlp_dims=(64,), dropout=0.2)
    elif name == 'lstm4fd':
        return LSTM4FDModel(field_dims, embed_dim=16, sequence_length=11, lstm_dims=20, mlp_dims=(64,),
                            dropouts=(0.2, 0.2))
    elif name == 'm3r':
        return SeqM3RModel(field_dims, embed_dim=16, sequence_length=11, lstm_dims=20, mlp_dims=(64,),
                           dropouts=(0.2, 0.2))
    else:
        raise ValueError('unknown model name: ' + name)
def get_model ( name , field_dims ) : if name == 'nfm' : return NeuralFactorizationMachineModel ( field_dims , embed_dim = 16 , mlp_dims = ( 64 , ) , dropouts = ( 0.2 , 0.2 ) ) elif name == 'hen' : return HENModel ( field_dims , embed_dim = 16 , sequence_length = 11 , lstm_dims = 20 , mlp_dims = ( 64 , ) , dropouts = ( 0.2 , 0.2 ) ) elif name == 'wd' : return WideAndDeepModel ( field_dims , embed_dim = 16 , mlp_dims = ( 64 , ) , dropout = 0.2 ) elif name == 'lstm4fd' : return LSTM4FDModel ( field_dims , embed_dim = 16 , sequence_length = 11 , lstm_dims = 20 , mlp_dims = ( 64 , ) , dropouts = ( 0.2 , 0.2 ) ) elif name == 'm3r' : return SeqM3RModel ( field_dims , embed_dim = 16 , sequence_length = 11 , lstm_dims = 20 , mlp_dims = ( 64 , ) , dropouts = ( 0.2 , 0.2 ) ) else : raise ValueError ( 'unknown model name: ' + name )