コード例 #1
0
ファイル: network.py プロジェクト: JoHNNyB92/thesis_code
 def insert_in_annetto_netwr(self):
     rdfWrapper.new_named_individual(self.name)
     rdfWrapper.new_type(self.name, self.type)
     temp_dict_layer=self.layer.copy()
     for elem in temp_dict_layer.keys():
         for elem_out in self.output_layer:
             if elem_out.name==elem and elem in self.layer.keys():
                 del self.layer[elem]
     for layer_name in self.layer.keys():
         self.layer[layer_name].insert_in_annetto()
         rdfWrapper.new_network_has_layer(self.name, layer_name)
     if self.objective!="":
         for objective_name in self.objective.keys():
             self.objective[objective_name].insert_in_annetto()
             rdfWrapper.new_network_has_objective(self.name, objective_name)
     for elem in self.input_layer:
         elem.insert_in_annetto()
         rdfWrapper.new_input_layer(self.name,elem.name)
     out_inserted=[]
     for elem in self.output_layer:
         if elem.name not in out_inserted:
             out_inserted.append(elem.name)
             elem.insert_in_annetto()
             rdfWrapper.new_output_layer(self.name,elem.name)
     for elem in self.hang_dp:
         elem.insert_in_annetto()
コード例 #2
0
 def insert_in_annetto(self):
     #print("Annetto::TrainingStrategy-",self.name)
     rdfWrapper.new_named_individual(self.name)
     rdfWrapper.new_type(self.name, self.type)
     self.training_model.insert_in_annetto()
     for session in self.primary_training_session:
         session.insert_in_annetto()
         #TODO:FIND WHICH ONE IS FIRST
         rdfWrapper.new_has_prim_tr_session(self.name, session.name)
     rdfWrapper.new_trained_model(self.name, self.training_model.name)
コード例 #3
0
    def insert_in_annetto(self):
        rdfWrapper.new_named_individual(self.name)
        rdfWrapper.new_type(self.name, self.type)

        self.hasStopCondition.insert_in_annetto()
        rdfWrapper.new_has_stop_cond(self.name, self.hasStopCondition.name)
        self.primaryLoop.insert_in_annetto()
        if self.primaryLoop != "":
            rdfWrapper.new_has_primary_loop(self.name, self.primaryLoop.name)
        else:
            print("LOGGING:There is no primary loop.")
        for lstep in self.loopSteps:
            lstep.insert_in_annetto()
            rdfWrapper.new_has_looping_step(self.name, lstep.name)
コード例 #4
0
 def insert_in_annetto(self):
     rdfWrapper.new_named_individual(self.name)
     rdfWrapper.new_type(self.name, self.type)
     for network in nodes.handler.entitiesHandler.data.annConfiguration.networks.keys(
     ):
         network_node = nodes.handler.entitiesHandler.data.annConfiguration.networks[
             network]
         network_node.insert_in_annetto_netwr()
         rdfWrapper.new_network(self.name, network)
     for trStrategy in nodes.handler.entitiesHandler.data.annConfiguration.training_strategy.keys(
     ):
         trStrategy_node = nodes.handler.entitiesHandler.data.annConfiguration.training_strategy[
             trStrategy]
         trStrategy_node.insert_in_annetto()
         rdfWrapper.new_has_training_strategy(self.name, trStrategy)
コード例 #5
0
 def insert_in_annetto(self):
     if self.metric != "":
         rdfWrapper.new_named_individual(self.name)
         rdfWrapper.new_type(self.name, self.type)
         rdfWrapper.new_evaluates_ann_conf(self.name, self.ann_conf.name)
         for i, _ in enumerate(self.IOPipe):
             self.IOPipe[i].insert_in_annetto()
             rdfWrapper.new_evaluates_using_io(self.name,
                                               self.IOPipe[i].name)
         self.metric.insert_in_annetto()
         rdfWrapper.new_has_metric(self.name, self.metric.name)
         rdfWrapper.new_evaluates_network(self.name, self.network)
         rdfWrapper.new_with_tr_strategy(self.name,
                                         self.train_strategy.name)
     else:
         print("ERROR:Neural network w/o evaluation.")
コード例 #6
0
    def insert_in_annetto(self):
        rdfWrapper.new_named_individual(self.name)
        rdfWrapper.new_type(self.name, self.type)
        if self.hasTrainingStep != []:
            for ind, tr_step in enumerate(self.hasTrainingStep):
                tr_step.insert_in_annetto()
                rdfWrapper.new_has_training_step(self.name, tr_step.name)
        else:
            print("ERROR:TrainingStep is empty")

        if self.hasPrimaryTrainingStep != "":
            self.hasPrimaryTrainingStep.insert_in_annetto()
            rdfWrapper.new_has_primary_training_step(
                self.name, self.hasPrimaryTrainingStep.name)
        else:
            print("ERROR:PrimaryTrainingStep is empty")
コード例 #7
0
 def insert_in_annetto(self):
     res = rdfWrapper.new_named_individual(self.name)
     if res == 0:
         rdfWrapper.new_type(self.name, self.type)
         rdfWrapper.new_joins_layer(self.name, self.input_layer.name)
         if self.dataset != "":
             self.dataset.insert_in_annetto()
             rdfWrapper.new_joins_dataset(self.name, self.dataset.name)
コード例 #8
0
ファイル: in_out_layer.py プロジェクト: JoHNNyB92/thesis_code
 def insert_in_annetto(self):
     res = rdfWrapper.new_named_individual(self.name)
     if res == 0:
         rdfWrapper.new_type(self.name, self.type)
         if self.num_layer != "":
             rdfWrapper.layer_num_units(self.name, self.num_layer)
         else:
             print("ERROR:IN OUT W/O NUM LAYER")
コード例 #9
0
ファイル: layer.py プロジェクト: JoHNNyB92/thesis_code
 def insert_in_annetto(self):
     ret = rdfWrapper.new_named_individual(self.name)
     if ret == 0:
         rdfWrapper.new_type(self.name, self.type)
         for elem in self.next_layer:
             rdfWrapper.new_next_layer(self.name, elem)
         for elem in self.previous_layer:
             rdfWrapper.new_previous_layer(self.name, elem)
         if self.sameLayer != "":
             rdfWrapper.new_same_layer(self.name, self.sameLayer)
         else:
             if self.activation != None:
                 self.activation.insert_in_annetto()
                 rdfWrapper.new_has_activation(self.name,
                                               self.activation.name)
             if self.hasBias == True:
                 rdfWrapper.new_has_bias(self.name, self.hasBias)
             if self.num_layer == "":
                 print("ERROR:" + self.name + " NOT AVAILABLE NUM LAYER")
             else:
                 rdfWrapper.layer_num_units(self.name, self.num_layer)
コード例 #10
0
ファイル: function.py プロジェクト: JoHNNyB92/thesis_code
 def insert_in_annetto(self):
     rdfWrapper.new_named_individual(self.name)
     rdfWrapper.new_type(self.name, self.type)
コード例 #11
0
 def insert_in_annetto(self):
     rdfWrapper.new_named_individual(self.name)
     rdfWrapper.new_type(self.name, self.type)
     for weight in self.has_weight:
         weight.insert_in_annetto()
         rdfWrapper.new_has_weights(self.name,weight.name)
コード例 #12
0
ファイル: iterates_for.py プロジェクト: JoHNNyB92/thesis_code
 def insert_in_annetto(self):
     rdfWrapper.new_named_individual(self.name)
     rdfWrapper.new_type(self.name, self.type)
     rdfWrapper.new_num_of_iterations(self.name, self.num_of_iterations)
コード例 #13
0
 def insert_in_annetto(self):
     rdfWrapper.new_named_individual(self.name)
     rdfWrapper.new_type(self.name, self.type)
     self.cost_function.insert_in_annetto()
     rdfWrapper.new_has_cost(self.name, self.cost_function.name)
コード例 #14
0
 def insert_in_annetto(self):
     rdfWrapper.new_named_individual(self.name)
     rdfWrapper.new_type(self.name, self.type)
     rdfWrapper.new_trained_in_layer(self.name, self.trained_in_layer)
     rdfWrapper.new_trained_out_layer(self.name, self.trained_out_layer)