You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using function newlvq in net, I encountered the following error:
line 184, in newlvq
layer_out.np['w'][n][st:i].fill(1.0)
TypeError: slice indices must be integers or None or have an index method
on further investigation, I found that this relates to the solution #481.
The array produced by
line 181
inx = np.floor(cn0 * pc.cumsum())
needs to be changed from float64 to integers to be used as the i inputs in line 184.
while I would not call this an elegant solution, it does resolve the type issue:
**v = 0
new = []
for i in inx:
new.append(int(i))
v += 1**
for n, i in enumerate(**new**):
st = 0 if n == 0 else **new**[n - 1]
layer_out.np['w'][n:st:i].fill(1.0)
End of modification
net = Net(minmax, cn1, [layer_inp, layer_out],
[[-1], [0], [1]], train.train_lvq, error.MSE())
return net
Thanks,
Jonathan
The text was updated successfully, but these errors were encountered:
While using function newlvq in net, I encountered the following error:
line 184, in newlvq
layer_out.np['w'][n][st:i].fill(1.0)
TypeError: slice indices must be integers or None or have an index method
on further investigation, I found that this relates to the solution #481.
The array produced by
line 181
inx = np.floor(cn0 * pc.cumsum())
needs to be changed from float64 to integers to be used as the i inputs in line 184.
while I would not call this an elegant solution, it does resolve the type issue:
def newlvq(minmax, cn0, pc):
Modification begins
End of modification
Thanks,
Jonathan
The text was updated successfully, but these errors were encountered: