Ejemplo n.º 1
0
def visualize(params, folder):

    #Check matching files
    list_files = glob.glob(folder+"/*_model*.dat");
    print list_files;
    print "No. of files:", len(list_files);
    ### LOAD All the Models ###
    for model_file in list_files:
        
        model = pickle.load(open(model_file,'rb'));
        
        print ">Reading model :",model_file;
       
        print ">creating model...";
        print model;
        ndmmodel = ndmModel.ndmModel(params['numI'], params['numH'], params['numO'], model['best_sol']);

        print ">model created!", type(ndmmodel);

    
        #visualise the model
        print ">visualizing model";
        app = QtGui.QApplication(sys.argv);
        QtCore.qsrand(QtCore.QTime(0,0,0).secsTo(QtCore.QTime.currentTime()));
        widget2 = GraphWidget(ndmmodel,'Test Set');
        widget2.show();
Ejemplo n.º 2
0
    def evaluate(self, components):
        """
        Evaluates the specie's
        """

        model = ndmModel.ndmModel(self.params['numInputNodes'],
                                  self.params['numHiddenNodes'],
                                  self.params['numOutputNodes'],
                                  components);

        f = model.evaluate(self.train_set);

        return f;
Ejemplo n.º 3
0


#TODOLIST
#TODO: (Tommorow) Test build model from signature


#select componentsesentatives
components = dict();
components['hidden_nodes'] = hidden_nodes;
components['out_nodes'] = out_nodes;
#select random connections and weights
components['model'] = model;
components['connActive_IH'] = connActiveIH;
components['connActive_HH'] = connActiveHH;
components['connActive_HO'] = connActiveHO;
components['connWeights_IH'] = weightsIH;
components['connWeights_HH'] = weightsHH;
components['connWeights_HO'] = weightsHO;




ndmmodel = ndmModel.ndmModel(params['numI'], params['numH'], params['numO'], components);
print "inputs:", datasets.XOR['IN'][0];
o = ndmmodel.stimulate(datasets.XOR['IN'][0]);
o2 = ndmmodel.stimulate(datasets.XOR['IN'][1]);

print "net out:", o;
print "out:", datasets.XOR['OUT'][0];
print "err:", ndmmodel.evaluate(datasets.XOR);