Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autograd in MLR #16

Open
vollmersj opened this issue May 22, 2018 · 0 comments
Open

Autograd in MLR #16

vollmersj opened this issue May 22, 2018 · 0 comments

Comments

@vollmersj
Copy link

AutoGrad through model does not work properly. Does this work with one of the other autodiff packages http://www.juliadiff.org/

using MLMetrics

function tmp(s::AutoGrad.Rec{Float64})
    
    model = SModel(data[:, [1,2,3]], data[:, 4], nothing,s*ones(3), L2DistLoss(), L2Penalty())
    learn!(model)
    
    MLMetrics.mean_squared_error(data[:, 4],predict(model, data[:, [1,2,3]]))
end
tmp(1.0)
g=AutoGrad.grad(tmp)
g(1.0)

# work around 

using DiffEqDiffTools
DiffEqDiffTools.finite_difference_derivative(tmp,1.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant