Skip to content

Commit

Permalink
rm frontmatter.yml after consolidating with citation.cff
Browse files Browse the repository at this point in the history
pnpm i -D js-yaml
fix link to landing page overlapping with nav
add image to Wrenformer model card
  • Loading branch information
janosh committed Jun 20, 2023
1 parent fd8355d commit 228be00
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 38 deletions.
37 changes: 21 additions & 16 deletions citation.cff
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
cff-version: 1.2.0
title: Matbench Discovery
# cff-version: 1.2.0
message: If you use this software, please cite it as below.
title: Matbench Discovery
subtitle: Can machine learning identify stable crystals?
authors:
- family-names: Riebesell
given-names: Janosh
- given-names: Janosh
family-names: Riebesell
affiliation: University of Cambridge, Lawrence Berkeley National Laboratory
email: [email protected]
orcid: https://orcid.org/0000-0001-5233-3462
corresponding: true
- family-names: Goodall
given-names: Rhys
affil_key: 1, 2
- given-names: Rhys
family-names: Goodall
affiliation: University of Cambridge
orcid: https://orcid.org/0000-0002-6589-1700
- family-names: Jain
given-name: Anubhav
affil_key: 1
- given-names: Anubhav
family-names: Jain
orcid: 0000-0001-5893-9967
affiliation: Lawrence Berkeley National Laboratory
- family-names: Persson
given-name: Kristin
affil_key: 2
- given-names: Kristin
family-names: Persson
orcid: 0000-0003-2495-5509
affiliation: Lawrence Berkeley National Laboratory
- family-names: King-Smith
given-name: Emma
orcid: 0000-0002-2999-0955
affiliation: University of Cambridge
- family-names: Lee
given-name: Alpha
affil_key: 2
- given-names: Alpha
family-names: Lee
orcid: 0000-0002-9616-3108
affiliation: University of Cambridge
affil_key: 1
affiliations:
- Cavendish Laboratory, University of Cambridge, UK
- Lawrence Berkeley National Laboratory, Berkeley, USA
license: MIT
license-url: https://github.com/janosh/matbench-discovery/blob/main/license"
repository-code: https://github.com/janosh/matbench-discovery
Expand Down
10 changes: 7 additions & 3 deletions models/cgcnn/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
Ensemble Size: 10

notes:
description: Published in 2017, CGCNN was the first crystal graph convolutional neural network to directly learn 8 different DFT-computed material properties from a graph representing the atoms and bonds in a crystal. ![Illustration of the crystal graph convolutional neural networks](https://researchgate.net/profile/Tian-Xie-11/publication/320726915/figure/fig1/AS:635258345119746@1528468800829/Illustration-of-the-crystal-graph-convolutional-neural-networks-a-Construction-of-the.png)
long: It showed that just like in other areas of ML, given large training sets, embeddings that outperform human-engineered features could be learned directly from the data.
description: |
Published in 2018, CGCNN was the first crystal graph convolutional neural network to directly learn 8 different DFT-computed material properties from a graph representing the atoms and bonds in a crystal.
![Illustration of the crystal graph convolutional neural networks](https://researchgate.net/profile/Tian-Xie-11/publication/320726915/figure/fig1/AS:635258345119746@1528468800829/Illustration-of-the-crystal-graph-convolutional-neural-networks-a-Construction-of-the.png)
long: CGCNN was among the first to show that just like in other areas of ML, given large enough training sets, neural networks can learn embeddings that reliably outperform all human-engineered structure features directly from the data.

- model_name: CGCNN+P
model_version: 0.1.0 # the aviary version
Expand Down Expand Up @@ -60,5 +62,7 @@
Perturbations: 5

notes:
description: This work proposes simple structure perturbations to augment CGCNN's training data of relaxed structures with randomly perturbed ones resembling unrelaxed structures that are mapped to the same DFT final energy during training. ![Step function PES](https://media.springernature.com/full/springer-static/image/art%3A10.1038%2Fs41524-022-00891-8/MediaObjects/41524_2022_891_Fig1_HTML.png?as=webp)
description: |
This work proposes simple structure perturbations to augment CGCNN's training data of relaxed structures with randomly perturbed ones resembling unrelaxed structures that are mapped to the same DFT final energy during training.
![Step function PES](https://media.springernature.com/full/springer-static/image/art%3A10.1038%2Fs41524-022-00891-8/MediaObjects/41524_2022_891_Fig1_HTML.png?as=webp)
long: The model is essentially taught the potential energy surface (PES) is a step-function that maps each valley to its local minimum. The expectation is that during testing on unrelaxed structures, the model will predict the energy of the nearest basin in the PES. The authors confirm this by demonstrating a lowering of the energy error on unrelaxed structures.
6 changes: 5 additions & 1 deletion models/wrenformer/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@ hyperparams:
Ensemble Size: 10

notes:
description: Wrenformer is a standard PyTorch Transformer Encoder trained to learn material embeddings from composition, space group, Wyckoff positions in a structure.
description: |
Wrenformer is a standard PyTorch Transformer Encoder trained to learn material embeddings from composition, space group, Wyckoff positions in a structure.
![Model workings](https://science.org/cms/10.1126/sciadv.abn4117/asset/a29e0899-77d1-47c8-82e3-00ab87c3b8d5/assets/images/large/sciadv.abn4117-f1.jpg)
A ML–powered materials discovery workflow using Wrenformer's Wyckoff string inputs to predict formation energies for candidate materials in an enumerated library of Wyckoff representations (shapes are used to denote different Wyckoff positions and colors to denote different element types). Predicted formation energies are then compared against the known convex hull of stability. Structures satisfying the required symmetries are relaxed for materials predicted to be stable.
long: It builds on [Roost](https://doi.org/10.1038/s41467-020-19964-7) and [Wren](https://doi.org/10.1126/sciadv.abn4117), by being a fast structure-free model that is still able to distinguish polymorphs through symmetry.
1 change: 1 addition & 0 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"eslint": "^8.34.0",
"eslint-plugin-svelte3": "^4.0.0",
"hastscript": "^7.2.0",
"js-yaml": "^4.1.0",
"katex": "^0.16.4",
"mdsvex": "^0.10.6",
"prettier": "^2.8.4",
Expand Down
6 changes: 3 additions & 3 deletions site/src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ declare module '*metadata.yml' {
}

// paper metadata
declare module '*frontmatter.yml' {
const frontmatter: import('$lib').Frontmatter
export = frontmatter
declare module '*citation.cff' {
const data: import('$lib').Citation
export = data
}

declare module '*references.yaml' {
Expand Down
11 changes: 8 additions & 3 deletions site/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,20 @@ export type Reference = {
ISSN?: string
}

export type Frontmatter = {
export type Citation = {
title: string
subtitle?: string
tags: string[]
authors: {
name: string
affiliation: string
affil_key: string
orcid: string
}[]
affiliations: string[]
date: string
'date-released': string
license: string
'license-url': string
'repository-code': string
url: string
version: string
}
15 changes: 11 additions & 4 deletions site/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,21 @@
max-width: 50em;
}
a[href='/'] {
font-size: 15pt;
position: absolute;
top: 2em;
left: 2em;
font-size: 14pt;
background-color: rgba(255, 255, 255, 0.1);
padding: 1pt 5pt;
border-radius: 3pt;
transition: 0.2s;
width: max-content;
box-sizing: border-box;
margin: 1em 0 0 1em;
}
@media (min-width: 900px) {
a[href='/'] {
position: absolute;
top: 1em;
left: 1em;
}
}
a[href='/']:hover {
background-color: rgba(255, 255, 255, 0.2);
Expand Down
4 changes: 3 additions & 1 deletion site/src/routes/paper/+layout.server.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import fs from 'fs'
import yml from 'js-yaml'
import type { LayoutServerLoad } from './$types'

export const load: LayoutServerLoad = async ({ route }) => {
const data = fs.readFileSync(`src/routes/${route.id}/+page.md`, `utf8`)
const cff = fs.readFileSync(`../citation.cff`, `utf8`)

// Count the number of words using a regular expression
const word_count = data.match(/\b\w+\b/g)?.length ?? null

return { word_count }
return { word_count, ...yml.load(cff) }
}
15 changes: 8 additions & 7 deletions site/src/routes/paper/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@
import { References } from '$lib'
import { pretty_num } from 'elementari/labels'
import type { LayoutServerData } from './$types'
import { affiliations, authors, date, subtitle, title } from './frontmatter.yml'
import { references } from './references.yaml'
export let data: LayoutServerData
const authors = data.authors.map(
(auth) => `${auth[`given-names`]} ${auth[`family-names`]}<sup>${auth.affil_key}</sup>`
)
</script>

<h1>{title}<br /><small>{subtitle}</small></h1>
<h1>{data.title}<br /><small>{data.subtitle}</small></h1>

<address>
<span>
{@html authors
.map((author) => `${author.name}<sup>${author.affiliation}</sup>`)
.join(`, `)}
{@html authors.join(`, `)}
</span>
<span>
{@html affiliations.map((affil, idx) => `${idx + 1}. ${affil}`).join(`<br/>`)}
{@html data.affiliations.map((affil, idx) => `${idx + 1}. ${affil}`).join(`<br/>`)}
</span>
<span style="font-weight: lighter;">{date}</span>
<span style="font-weight: lighter;">{data[`date-released`]}</span>
</address>

<div>
Expand Down

0 comments on commit 228be00

Please sign in to comment.