示例#1
0
    def __init__(self,
                 device,
                 name,
                 edge_dimension,
                 meta_data_dimension,
                 decimator_dimension,
                 mem_hidden_dimension,
                 agg_hidden_dimension,
                 mem_agg_hidden_dimension,
                 prediction_dimension,
                 variable_classifier=None,
                 function_classifier=None,
                 dropout=0,
                 local_search_iterations=0,
                 epsilon=0.05):

        super(NeuralSurveyPropagatorSolver, self).__init__(
            device=device,
            name=name,
            propagator=pdp_propagate.SurveyPropagator(device,
                                                      decimator_dimension,
                                                      include_adaptors=True),
            decimator=pdp_decimate.NeuralDecimator(
                device, (3, 2), meta_data_dimension, decimator_dimension,
                mem_hidden_dimension, mem_agg_hidden_dimension,
                agg_hidden_dimension, edge_dimension, dropout),
            predictor=pdp_predict.NeuralPredictor(
                device, decimator_dimension, prediction_dimension,
                edge_dimension, meta_data_dimension, mem_hidden_dimension,
                agg_hidden_dimension, mem_agg_hidden_dimension,
                variable_classifier, function_classifier),
            local_search_iterations=local_search_iterations,
            epsilon=epsilon)
示例#2
0
 def __init__(
     self,
     device,
     name,
     edge_dimension,
     meta_data_dimension,
     propagator_dimension,
     decimator_dimension,
     mem_hidden_dimension,
     agg_hidden_dimension,
     mem_agg_hidden_dimension,
     prediction_dimension,
     variable_classifier=None,
     function_classifier=None,
     dropout=0,
     local_search_iterations=0,
     epsilon=0.05,
 ):
     super(NeuralPropagatorDecimatorSolver, self).__init__(
         device=device,
         name=name,
         propagator=pdp_propagate.NeuralMessagePasser(
             device,
             edge_dimension,
             decimator_dimension,
             meta_data_dimension,
             propagator_dimension,
             mem_hidden_dimension,
             mem_agg_hidden_dimension,
             agg_hidden_dimension,
             dropout,
         ),
         decimator=pdp_decimate.NeuralDecimator(
             device,
             propagator_dimension,
             meta_data_dimension,
             decimator_dimension,
             mem_hidden_dimension,
             mem_agg_hidden_dimension,
             agg_hidden_dimension,
             edge_dimension,
             dropout,
         ),
         predictor=pdp_predict.NeuralPredictor(
             device,
             decimator_dimension,
             prediction_dimension,
             edge_dimension,
             meta_data_dimension,
             mem_hidden_dimension,
             agg_hidden_dimension,
             mem_agg_hidden_dimension,
             variable_classifier,
             function_classifier,
         ),
         local_search_iterations=local_search_iterations,
         epsilon=epsilon,
     )
示例#3
0
 def __init__(
     self,
     device,
     name,
     edge_dimension,
     meta_data_dimension,
     propagator_dimension,
     decimator_dimension,
     mem_hidden_dimension,
     agg_hidden_dimension,
     mem_agg_hidden_dimension,
     classifier_dimension,
     dropout,
     tolerance,
     t_max,
     local_search_iterations=0,
     epsilon=0.05,
 ):
     super(NeuralSequentialDecimatorSolver, self).__init__(
         device=device,
         name=name,
         propagator=pdp_propagate.NeuralMessagePasser(
             device,
             edge_dimension,
             decimator_dimension,
             meta_data_dimension,
             propagator_dimension,
             mem_hidden_dimension,
             mem_agg_hidden_dimension,
             agg_hidden_dimension,
             dropout,
         ),
         decimator=pdp_decimate.SequentialDecimator(
             device,
             message_dimension=(3, 1),
             scorer=pdp_predict.NeuralPredictor(
                 device,
                 decimator_dimension,
                 1,
                 edge_dimension,
                 meta_data_dimension,
                 mem_hidden_dimension,
                 agg_hidden_dimension,
                 mem_agg_hidden_dimension,
                 variable_classifier=util.PerceptronTanh(
                     decimator_dimension, classifier_dimension, 1
                 ),
                 function_classifier=None,
             ),
             tolerance=tolerance,
             t_max=t_max,
         ),
         predictor=pdp_predict.IdentityPredictor(device=device, random_fill=True),
         local_search_iterations=local_search_iterations,
         epsilon=epsilon,
     )