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

Differential Learning of Interactions #50

Open
moradza opened this issue Jan 12, 2022 · 0 comments
Open

Differential Learning of Interactions #50

moradza opened this issue Jan 12, 2022 · 0 comments

Comments

@moradza
Copy link

moradza commented Jan 12, 2022

Hi,

I was wondering if it is possible to combine NBodySimulator.jl with DiffEqFlux.jl to learn interaction parameters to reproduce a given RDF. loss is the distance euclidean distance between ground truth and current parameter RDFs to make it differentiable. I have done something similar for stochastic lotka_volterra.

Calculation of RDF is done through a function like this, where x's are radial distances of neighboring atoms.

rkMin = 0 # Ang
rkMax = 10 #Ang
nrk = 80
rk = LinRange(rkMin, rkMax, nrk)

function kernelHist(x, rk=rk)
dr = rk[2] - rk[1]
#x = reshape(x, (1, size(x)[2]size(x)[1]))
dx2 = .-(rk .- x).^2 ./ (2
dr^2)
denUn = exp.(dx2 ./ (2dr^2))
denN = denUn ./ sum(denUn .+ 1e-16, dims=1)
totalDenUn = sum(denN, dims = 2)
totalDenUn ./= sum(totalDenUn .
dr)
totalDenUn = reshape(totalDenUn, size(totalDenUn)[1])
#totalDenUn
totalDenUn
end

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