Skip to content

Commit

Permalink
Small improvements in make.jl and Na example.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuellujan committed Jul 5, 2024
1 parent 507cce3 commit 1d8bf75
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
26 changes: 16 additions & 10 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,36 @@ end

# Basic examples
examples = [
"1 - Fit a-HfO2 dataset with ACE" => "ACE-aHfO2/fit-ace-ahfo2.jl",
"2 - Load Ar+Lennard-Jones dataset and postprocess" => "LJ-Ar/lennard-jones-ar.jl"
"Example 1 - Fit a-HfO2 dataset with ACE" => "ACE-aHfO2/fit-ace-ahfo2.jl",
]
basic_examples = create_examples(examples, EXAMPLES_DIR, OUTPUT_DIR)

# Subsampling examples
examples = [
"1 - Subsample a-HfO2 dataset with DPP and fit with ACE" => "DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2.jl",
"2 - Subsample Na dataset with DPP and fit with ACE" => "DPP-ACE-Na/fit-dpp-ace-na.jl",
"3 - Subsample Si dataset with DPP, fit with ACE, and cross validate" => "DPP-ACE-Si/fit-dpp-ace-si.jl",
"Example 1 - Subsample a-HfO2 dataset with DPP and fit with ACE" => "DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2.jl",
"Example 2 - Subsample Na dataset with DPP and fit with ACE" => "DPP-ACE-Na/fit-dpp-ace-na.jl",
"Example 3 - Subsample Si dataset with DPP, fit with ACE, and cross validate" => "DPP-ACE-Si/fit-dpp-ace-si.jl",
]
ss_examples = create_examples(examples, EXAMPLES_DIR, OUTPUT_DIR)

# Optimization examples
examples = [
"1 - Optimize ACE hyper-parameters: minimize force time and fitting error" => "Opt-ACE-aHfO2/fit-opt-ace-ahfo2.jl",
"Example 1 - Optimize ACE hyper-parameters: minimize force time and fitting error" => "Opt-ACE-aHfO2/fit-opt-ace-ahfo2.jl",
]
opt_examples = create_examples(examples, EXAMPLES_DIR, OUTPUT_DIR)

# Dimension reduction examples
examples = [
"1 - Reduce ACE descriptors with PCA and fit a-HfO2 dataset" => "PCA-ACE-aHfO2/fit-pca-ace-ahfo2.jl",
"Example 1 - Reduce ACE descriptors with PCA and fit a-HfO2 dataset" => "PCA-ACE-aHfO2/fit-pca-ace-ahfo2.jl",
]
dr_examples = create_examples(examples, EXAMPLES_DIR, OUTPUT_DIR)

examples = [
"Example 1 - Load Ar+Lennard-Jones dataset and postprocess" => "LJ-Ar/lennard-jones-ar.jl"
]
misc_examples = create_examples(examples, EXAMPLES_DIR, OUTPUT_DIR)


# Make and deploy docs #########################################################

makedocs(
Expand All @@ -77,9 +82,10 @@ makedocs(
pages = ["Home" => "index.md",
"How to run the examples" => "how-to-run-the-examples.md",
"Basic examples" => basic_examples,
"Optimize atomistic data via intelligent subsampling" => ss_examples,
"Optimize interatomic potential models via hyper-paramter optimization" => opt_examples,
"Optimize interatomic potential models via dimension reduction" => dr_examples,
"Intelligent subsampling" => ss_examples,
"Hyper-paramter optimization" => opt_examples,
"Dimension reduction" => dr_examples,
"Misc" => misc_examples,
"API" => "api.md"],
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", "false") == "true",
Expand Down
4 changes: 2 additions & 2 deletions examples/DPP-ACE-Na/fit-dpp-ace-na.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ dpp = kDPP(ds_train, GlobalMean(), DotProduct(); batch_size = 200)
# Subsample trainig dataset.
dpp_inds = get_random_subset(dpp)

# ## Learn ACE coefficients based on ACE descriptors and DFT data.
# ## e. Learn ACE coefficients based on ACE descriptors and DFT data.
lb = LBasisPotential(ace)
α = 1e-8
Σ = learn!(lb, ds_train[dpp_inds], α)

# ## e. Post-process output: calculate metrics, create plots, and save results.
# ## f. Post-process output: calculate metrics, create plots, and save results.

# Update test dataset by adding energy descriptors.
println("Computing local descriptors of test dataset")
Expand Down

0 comments on commit 1d8bf75

Please sign in to comment.