Giter Club home page Giter Club logo

Comments (8)

chc273 avatar chc273 commented on September 28, 2024

@YunxingZuo it seems that there are no validation data inputs for the NNP training, but the codes try to find validation errors from outputs. Could you please check that? THANKS!

from maml.

YunxingZuo avatar YunxingZuo commented on September 28, 2024

Essentially the underlying n2p2 use the keyword "test_fraction" to split the data inputs into training and validation set. In maml, the default value is set to 0 as all the data inputs are used for training. A separate test dataset is used for evaluation. @Akram-Ibrahim Can you provide a snippet of code/data for us to reproduce the error you met? The version information of n2p2 and maml are appreciated.

from maml.

Akram-Ibrahim avatar Akram-Ibrahim commented on September 28, 2024

@YunxingZuo I'm using maml 0.0.2. For n2p2, I've cloned the n2p2 github repository a week ago.
Here is a snippet of my code/data.
snippet.zip

Thank you for the help!

from maml.

YunxingZuo avatar YunxingZuo commented on September 28, 2024

@Akram-Ibrahim Please update the maml package and run the code again. The error is due to the minor change of the new n2p2 output format. They changed the keyword "FORCES" to "FORCE". Now the NNPotential module is compatible with both new and old versions of n2p2.

from maml.

Akram-Ibrahim avatar Akram-Ibrahim commented on September 28, 2024

@YunxingZuo Thank you so much. However, I've tried updating the maml package with pip but I still get the version 0.0.2 and the error is still occurring with the NNPotential.

from maml.

YunxingZuo avatar YunxingZuo commented on September 28, 2024

This is strange... Could you run the following snippet of code and paste the file "training_output"? Thanks.

import numpy as np
import pandas as pd
from pymatgen import Structure
import subprocess
from pymatgen.io.vasp.outputs import Vasprun
import os
import json
from maml.utils import pool_from, convert_docs, check_structures_forces_stresses

# load the training pymatgen structures
with open('structures.json', 'r') as f:
    d = json.load(f)

train_structures = [Structure.from_dict(x) for x in d]  

# load the training energies
with open('energies.json', 'r') as f:
    d= json.load(f)
    
train_energies = [x for x in d] 

# load the training forces 
with open('forces.json', 'r') as f:
    d= json.load(f)
    
train_forces = [x for x in d] 

# train potential step by step
train_structures, train_forces, train_stresses = check_structures_forces_stresses(
    train_structures, train_forces, None)
train_pool = pool_from(train_structures, train_energies, train_forces, train_stresses)
atoms_filename = "input.data"
_ = nnp.write_cfgs(filename=atoms_filename, cfg_pool=train_pool)
output = "training_output"
nnp.write_input(cutoff_type=1,
          r_etas = [0.5, 2.0], a_etas = [0.5, 2.0],
          r_shift=[0.0],
          zetas=[1.0, 4.0],
          r_cut=4.2, hidden_layers=[2, 2], epochs=3)

p_scaling = subprocess.Popen(["nnp-scaling", "100"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p_scaling.communicate()

p_train = subprocess.Popen(["nnp-train"], stdout=open(output, "w"), stderr=subprocess.PIPE)
stdout, stderr = p_train.communicate()

from maml.

chc273 avatar chc273 commented on September 28, 2024

@Akram-Ibrahim @YunxingZuo I just did a release. Version 0.0.4 should be available now via pypi

from maml.

Akram-Ibrahim avatar Akram-Ibrahim commented on September 28, 2024

@chc273 @YunxingZuo Thanks a lot. I've updated the maml package now and the 0.0.4 has been loaded and the error doesn't appear anymore.

from maml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.