Skip to content

Commit a6060dd

Browse files
committed
Addressing dependency issues and small fix in test.
1 parent e4a3b42 commit a6060dd

16 files changed

+57
-92
lines changed

Project.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
1212
InteratomicPotentials = "a9efe35a-c65d-452d-b8a8-82646cd5cb04"
1313
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
1414
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
15-
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
1615
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
17-
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
1816
OptimizationOptimisers = "42dfb2eb-d2b4-4451-abcd-913932933ac1"
1917
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
2018
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
@@ -28,5 +26,4 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
2826
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
2927

3028
[compat]
31-
julia = ">= 1.9"
32-
InteratomicPotentials = ">= 0.2.9"
29+
s

examples/Ar/Project.toml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[deps]
2+
AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
3+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
4+
InteratomicPotentials = "a9efe35a-c65d-452d-b8a8-82646cd5cb04"
5+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
6+
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
7+
UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"

examples/Ar/plot-lennard-jones-ar.jl

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
push!(Base.LOAD_PATH, "../../")
2-
using AtomsBase
2+
33
using Unitful, UnitfulAtomic
4-
using InteratomicPotentials
5-
using PotentialLearning
4+
using AtomsBase, InteratomicPotentials, PotentialLearning
65
using LinearAlgebra, CairoMakie
76

87
# Load dataset: Lennard-Jones + Argon

examples/DFT-subsampling/Project.toml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[deps]
2+
AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
3+
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
4+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
5+
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
6+
Determinantal = "2673d5e8-682c-11e9-2dfd-471b09c6c819"
7+
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
8+
InteratomicPotentials = "a9efe35a-c65d-452d-b8a8-82646cd5cb04"
9+
InvertedIndices = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
10+
JLD = "4138dd39-2aa7-5051-a626-17a0bb65d9c8"
11+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
12+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
13+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
14+
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
15+
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
16+
UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"

examples/DFT-subsampling/subsampling_dpp.jl

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
push!(Base.LOAD_PATH, "../../")
22

3-
using PotentialLearning
4-
using LinearAlgebra, Random, Statistics, StatsBase, Distributions
5-
using AtomsBase, Unitful, UnitfulAtomic
6-
using InteratomicPotentials
7-
using Determinantal
3+
using LinearAlgebra, Random, InvertedIndices
4+
using Statistics, StatsBase, Distributions, Determinantal
5+
using Unitful, UnitfulAtomic
6+
using AtomsBase, InteratomicPotentials, PotentialLearning
7+
using CSV, JLD, DataFrames
88
using CairoMakie
9-
using InvertedIndices
10-
using CSV
11-
using JLD
12-
using DataFrames
139

1410
include("subsampling_utils.jl")
1511

@@ -60,7 +56,7 @@ ds = DataSet(confs .+ e_descr .+ f_descr)
6056
ndata = length(ds)
6157

6258
# Compute cross validation error from training ---------------------------------
63-
batch_size = [80, 40, 20]
59+
batch_size = [80, 40]
6460
sel_ind = Dict{Int64, Vector}()
6561
cond_num = Dict{Int64, Vector}()
6662

examples/Na/Project.toml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[deps]
2+
AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
3+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
4+
InteratomicPotentials = "a9efe35a-c65d-452d-b8a8-82646cd5cb04"
5+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
6+
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
7+
UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"

examples/Na/fit-dpp-ace-na.jl

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
push!(Base.LOAD_PATH, "../../")
22

3-
using AtomsBase
4-
using InteratomicPotentials
5-
using PotentialLearning
63
using Unitful, UnitfulAtomic
7-
using LinearAlgebra
8-
using CairoMakie
9-
#using JLD
4+
using AtomsBase, InteratomicPotentials, PotentialLearning
5+
using LinearAlgebra, CairoMakie
106

117
# Load dataset
128
confs, thermo = load_data("data/liquify_sodium.yaml", YAML(:Na, u"eV", u""))

examples/Project.toml

-41
This file was deleted.

examples/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $ cd PotentialLearning.jl/examples/Na
77

88
Open Julia REPL, activate ```Project.toml``` file in folder ```examples```, and chose the number of threads. E.g.
99
```bash
10-
$ julia --project=.. --threads=4
10+
$ julia --project=. --threads=4
1111
```
1212

1313
Type ```]``` in Julia REPL, and then run ```instantiate```.

examples/aHfO2/build_dpp.jl

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
push!(Base.LOAD_PATH, "../../")
22

3-
using LinearAlgebra, Random, Statistics, StatsBase, Distributions
4-
using AtomsBase, Unitful, UnitfulAtomic
5-
using InteratomicPotentials
6-
using CairoMakie
7-
using JLD
8-
using Determinantal
9-
using PotentialLearning
3+
using LinearAlgebra, Random
4+
using Statistics, StatsBase, Distributions, Determinantal
5+
using Unitful, UnitfulAtomic
6+
using AtomsBase, InteratomicPotentials, PotentialLearning
7+
using JLD, CairoMakie
108

119
#################### Importing Data ###################
1210
# Import Raw Data

examples/aHfO2/build_multiple_dpp.jl

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
push!(Base.LOAD_PATH, "../../")
22

3-
using LinearAlgebra, Random, Statistics, StatsBase, Distributions
4-
using AtomsBase, Unitful, UnitfulAtomic
5-
using InteratomicPotentials, InteratomicBasisPotentials
6-
using CairoMakie
7-
using JLD
8-
using Determinantal
9-
using PotentialLearning
3+
using LinearAlgebra, Random
4+
using Statistics, StatsBase, Distributions, Determinantal
5+
using Unitful, UnitfulAtomic
6+
using AtomsBase, InteratomicPotentials, PotentialLearning
7+
using JLD, CairoMakie
108

119
#################### Importing Data ###################
1210
# Import Raw Data

src/Learning/linear-learn.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function learn!(
5656
x0 = [log(lp.σe[1]), log(lp.σf[1]), lp.β...]
5757
p = [AtAe, Atbe, AtAf, Atbf, α]
5858
prob = Optimization.OptimizationProblem(g, x0, p)
59-
sol = Optimization.solve(prob, Optim.BFGS())
59+
sol = Optimization.solve(prob, OptimizationOptimisers.Adam(), maxiters = 1000)
6060
lp.σe .= exp(sol.u[1])
6161
lp.σf .= exp(sol.u[2])
6262
lp.β .= sol.u[3:end]

src/PotentialLearning.jl

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ using OrderedCollections
99
using Flux
1010
using Zygote
1111
using Optimization
12-
using Optim
13-
using OptimizationOptimJL
1412
using OptimizationOptimisers
1513
using Printf
1614

src/interface.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ using LinearAlgebra
1212
using StaticArrays
1313
using Statistics
1414
using Optimization
15-
using OptimizationOptimJL
15+
using OptimizationOptimisers
1616
using UnitfulAtomic
1717
using Unitful
1818
using Flux

test/Project.toml

-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ Determinantal = "2673d5e8-682c-11e9-2dfd-471b09c6c819"
44
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
55
InteratomicPotentials = "a9efe35a-c65d-452d-b8a8-82646cd5cb04"
66
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
7-
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
87
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
9-
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
10-
OptimizationOptimisers = "42dfb2eb-d2b4-4451-abcd-913932933ac1"
118
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
129
PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
1310
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
@@ -19,6 +16,3 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1916
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
2017
UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"
2118
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
22-
23-
[compat]
24-
julia = "1.9"

test/dimension_reduction/dimension_reduction_tests.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ pca = PCA(num_dim)
2626
@test typeof(as) <: DimensionReducer
2727
@test typeof(pca) <: DimensionReducer
2828

29-
λ_as, W_as = fit(ds, as)
29+
λ_as, W_as = PotentialLearning.fit(ds, as)
3030
@test typeof(λ_as) <: Vector{Float64}
3131
@test typeof(W_as) <: Matrix{Float64}
3232
@test size(W_as, 1) == d
3333
@test size(W_as, 2) == num_dim
3434

35-
λ_pca, W_pca = fit(ds, pca)
35+
λ_pca, W_pca = PotentialLearning.fit(ds, pca)
3636
@test typeof(λ_pca) <: Vector{Float64}
3737
@test typeof(W_pca) <: Matrix{Float64}
3838
@test size(W_pca, 1) == d
3939
@test size(W_pca, 2) == num_dim
4040

41-
@test all(λ_as .≈ λ_pca)
41+
@test all(λ_as .≈ λ_pca)

0 commit comments

Comments
 (0)