Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

XOR example won't run with :gradient_descent #7

Closed
lendle opened this issue Jul 25, 2014 · 1 comment
Closed

XOR example won't run with :gradient_descent #7

lendle opened this issue Jul 25, 2014 · 1 comment

Comments

@lendle
Copy link

lendle commented Jul 25, 2014

maxiters here should be maxiter, I think. But even if I fix that, I cannot run the XOR example with gradient descent.

I get

`setindex!` has no method matching setindex!(::ContiguousView{Float64,1,Array{Float64,1}}, ::Array{Float64,2}, ::UnitRange{Int64})

You might have used a 2d row vector where a 1d column vector was required.
Note the difference between 1d column vector [1,2,3] and 2d row vector [1 2 3].
You can convert to a column vector with the vec() function.
while loading In[8], in expression starting on line 21
 in backprop! at /home/sam/.julia/v0.3/NeuralNets/src/backprop.jl:39
 in backprop! at /home/sam/.julia/v0.3/NeuralNets/src/backprop.jl:35 (repeats 2 times)
 in g! at /home/sam/.julia/v0.3/NeuralNets/src/train.jl:93
 in fg! at /home/sam/.julia/v0.3/Optim/src/types.jl:150
 in gradient_descent at /home/sam/.julia/v0.3/Optim/src/gradient_descent.jl:56
 in optimize at /home/sam/.julia/v0.3/Optim/src/optimize.jl:328
 in train at /home/sam/.julia/v0.3/NeuralNets/src/train.jl:97
@anj1
Copy link
Owner

anj1 commented Jul 25, 2014

This was a type issue with setindex!. Closed per this commit: 44d1674

@anj1 anj1 closed this as completed Jul 25, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants