Skip to content

Differential Learning of Interactions  #50

@moradza

Description

@moradza

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions