简体   繁体   English

pyfann中训练数据的格式是什么?

[英]What is the format of training data in pyfann?

What is the format of thraining data in pyfann? pyfann中限制数据的格式是什么? Concretely I would like to use the init_weight function of pyfann, but it does not take a range, but finds the range from traning data. 具体来说,我想使用pyfann的init_weight函数,但是它不占用范围,而是从转换数据中找到范围。 Therefore I would like to create a small fake dataset, which has the lowest and the highes value of what can be expected in the programm. 因此,我想创建一个小的伪数据集,该数据集具有程序设计中预期值的最低和最高值。

Frist Line, 3 arguments: number of data to train, number of inputs, number of outputs from there, goes one line of inputs and one of outputs eg (AND logic matrix): Frist Line,3个变元:要训练的数据数量,输入数量,从那里输出的数量,一行输入和一组输出,例如(AND逻辑矩阵):

4 2 1    
1 1    
1    
0 1    
0    
0 0    
0    
1 0    
0  

Above: 以上:

  • 4 datas to train: 4个要训练的数据:

    1 AND 1 = 1 1和1 = 1
    0 AND 1 = 0 0 AND 1 = 0
    0 AND 0 = 0 0 AND 0 = 0
    1 AND 0 = 0 1 AND 0 = 0

  • 2 inputs 2路输入

  • 1 output 1个输出

Now you can also use train_on_data , which receives the same arguments as train_on_file , but you change the filename with an object libfann.training_data() and set the lists of lists of input and output as (for the xor case): 现在,您还可以使用train_on_data ,它接受与train_on_file相同的参数,但是您可以使用对象libfann.training_data()更改文件名,并将输入和输出列表的列表设置为(对于xor情况):

training = libfann.training_data()    
training.set_train_data([[-1,-1],[-1,1],[1,-1],[1,1]],[[-1],[1],[1],[-1]])

you might find help on this page. 您可能会在此页面上找到帮助。

http://leenissen.dk/fann/html/files2/gettingstarted-txt.html#Execution http://leenissen.dk/fann/html/files2/gettingstarted-txt.html#Execution

half-way down the page there is a description of the training data format. 在页面的中间,有关于训练数据格式的描述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM