Convert Matlab code into Python using Neural Network Library

巧了我就是萌 提交于 2019-12-24 09:26:03

问题


I am trying to convert this code of matlab in python...

parpool
X = power;
T = coi;

net = feedforwardnet(10);
net = train(net,X,T,'useParallel','no','showResources','yes');
Y = net(X);
figure;

plot(X,T,'o',X,Y,'x');    

Here is Target File attached i.e Coi

Here is Input File attached i.e Power

I tried a little bit but getting error like assertion error when training

input_data = power # Power is my input array of length 45
output_data = coi # Coi is my output array of length 60000

h = np.max(input_data )
l = np.min(input_data )

net = nl.net.newff([[l, h]], [1, 1])

error = net.train(input_data, output_data)
out = net.sim(output_data)

Matlab code is working... but i want this same thing to work in python...

来源:https://stackoverflow.com/questions/43563836/convert-matlab-code-into-python-using-neural-network-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!