From 3926e856d4c492c61f649b2ea8502b9ca7832b66 Mon Sep 17 00:00:00 2001 From: Shyue Ping Ong Date: Thu, 13 Jun 2024 08:24:41 -0700 Subject: [PATCH] Update docs --- docs/CHANGES.md | 4 + docs/maml.apps.bowsr.md | 350 +-- docs/maml.apps.bowsr.model.md | 3 +- docs/maml.apps.gbe.md | 147 +- docs/maml.apps.md | 1791 ++++----------- docs/maml.apps.pes.md | 1481 ++++-------- docs/maml.apps.symbolic.md | 416 +--- docs/maml.base.md | 313 +-- docs/maml.data.md | 41 +- docs/maml.describers.md | 506 ++--- docs/maml.md | 3989 ++++++++------------------------- docs/maml.models.dl.md | 270 +-- docs/maml.models.md | 304 +-- docs/maml.sampling.md | 11 +- docs/maml.utils.md | 660 ++---- pyproject.toml | 2 +- tasks.py | 2 +- 17 files changed, 2719 insertions(+), 7571 deletions(-) diff --git a/docs/CHANGES.md b/docs/CHANGES.md index f256926b..e570df96 100644 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -1,5 +1,9 @@ # Change log +## 2024.6.13 +* Misc bug and doc fixes. +* Code cleanup. + ## v2023.9.9 * Added DIRECT sampling approach in `maml.sampling`. diff --git a/docs/maml.apps.bowsr.md b/docs/maml.apps.bowsr.md index 7685c7f4..fd0b29de 100644 --- a/docs/maml.apps.bowsr.md +++ b/docs/maml.apps.bowsr.md @@ -13,38 +13,17 @@ arXiv preprint arXiv:2104.10242 (2021). ## Subpackages - * [maml.apps.bowsr.model package](maml.apps.bowsr.model.md) - - + * `EnergyModel` + * `EnergyModel.predict_energy()` + * maml.apps.bowsr.model.base module * `EnergyModel` - - - * `EnergyModel.predict_energy()` - - - * maml.apps.bowsr.model.base module - - - * `EnergyModel` - - - * `EnergyModel.predict_energy()` - - - * maml.apps.bowsr.model.cgcnn module - - - * maml.apps.bowsr.model.dft module - - - * `DFT` - - - * `DFT.predict_energy()` - - - * maml.apps.bowsr.model.megnet module + * `EnergyModel.predict_energy()` + * maml.apps.bowsr.model.cgcnn module + * maml.apps.bowsr.model.dft module + * `DFT` + * `DFT.predict_energy()` + * maml.apps.bowsr.model.megnet module ## maml.apps.bowsr.acquisition module @@ -56,33 +35,25 @@ Bases: `object` An object to compute the acquisition functions. -#### *static* _ei(x: list | np.ndarray, gpr: GaussianProcessRegressor, y_max: float, xi: float, noise: float) +#### *static* \_ei(x: list | np.ndarray, gpr: GaussianProcessRegressor, y_max: float, xi: float, noise: float) -#### *static* _gpucb(x: list | np.ndarray, gpr: GaussianProcessRegressor, noise: float) +#### *static* \_gpucb(x: list | np.ndarray, gpr: GaussianProcessRegressor, noise: float) -#### *static* _poi(x: list | np.ndarray, gpr: GaussianProcessRegressor, y_max: float, xi: float, noise: float) +#### *static* \_poi(x: list | np.ndarray, gpr: GaussianProcessRegressor, y_max: float, xi: float, noise: float) -#### *static* _ucb(x: list | np.ndarray, gpr: GaussianProcessRegressor, kappa: float, noise: float) +#### *static* \_ucb(x: list | np.ndarray, gpr: GaussianProcessRegressor, kappa: float, noise: float) #### calculate(x: list | np.ndarray, gpr: GaussianProcessRegressor, y_max: float, noise: float) Calculate the value of acquisition function. - * **Parameters** - - * **x** (*ndarray*) – Query point need to be evaluated. - - - * **gpr** (*GaussianProcessRegressor*) – A Gaussian process regressor fitted to -known data. - - - * **y_max** (*float*) – The current maximum target value. - - - * **noise** (*float*) – Noise added to acquisition function if noisy-based Bayesian -optimization is performed, 0 otherwise. + * **x** (*ndarray*) – Query point need to be evaluated. + * **gpr** (*GaussianProcessRegressor*) – A Gaussian process regressor fitted to + known data. + * **y_max** (*float*) – The current maximum target value. + * **noise** (*float*) – Noise added to acquisition function if noisy-based Bayesian + optimization is performed, 0 otherwise. ### maml.apps.bowsr.acquisition._trunc(values: ndarray, decimals: int = 3) @@ -103,33 +74,21 @@ This can be an integer for a seeded rng or None for an unseeded rng. Latin hypercube sampling. - * **Parameters** - - * **n_intervals** (*int*) – Number of intervals. - - - * **bounds** (*nd.array*) – Bounds for each dimension. - - - * **random_state** (*RandomState*) – Random state. + * **n_intervals** (*int*) – Number of intervals. + * **bounds** (*nd.array*) – Bounds for each dimension. + * **random_state** (*RandomState*) – Random state. ### maml.apps.bowsr.acquisition.predict_mean_std(x: list | np.ndarray, gpr: GaussianProcessRegressor, noise: float) Speed up the gpr.predict method by manually computing the kernel operations. - * **Parameters** - - * **x** (*list/ndarray*) – Query point need to be evaluated. - - - * **gpr** (*GaussianProcessRegressor*) – A Gaussian process regressor fitted to -known data. - - - * **noise** (*float*) – Noise added to standard deviation if test target -instead of GP posterior is sampled. 0 otherwise. + * **x** (*list/ndarray*) – Query point need to be evaluated. + * **gpr** (*GaussianProcessRegressor*) – A Gaussian process regressor fitted to + known data. + * **noise** (*float*) – Noise added to standard deviation if test target + instead of GP posterior is sampled. 0 otherwise. ### maml.apps.bowsr.acquisition.propose_query_point(acquisition, scaler, gpr, y_max, noise, bounds, random_state, sampler, n_warmup=10000) @@ -138,37 +97,19 @@ It uses a combination of random sampling (cheap) and the ‘L-BFGS-B’ optimization method by first sampling n_warmup points at random and running L-BFGS-B from n_iter random starting points. - * **Parameters** - - * **acquisition** – The acquisition function. - - - * **scaler** – The Scaler used to transform features. - - - * **gpr** (*GaussianProcessRegressor*) – A Gaussian process regressor fitted to -known data. - - - * **y_max** (*float*) – The current maximum target value. - - - * **noise** (*float*) – The noise added to the acquisition function if noisy-based -Bayesian optimization was performed. - - - * **bounds** (*ndarray*) – The bounds of candidate points. - - - * **random_state** (*RandomState*) – Random number generator. - - - * **sampler** (*str*) – Sampler generating warmup points. “uniform” or “lhs”. - - - * **n_warmup** (*int*) – Number of randomly sampled points to select the initial -point for minimization. + * **acquisition** – The acquisition function. + * **scaler** – The Scaler used to transform features. + * **gpr** (*GaussianProcessRegressor*) – A Gaussian process regressor fitted to + known data. + * **y_max** (*float*) – The current maximum target value. + * **noise** (*float*) – The noise added to the acquisition function if noisy-based + Bayesian optimization was performed. + * **bounds** (*ndarray*) – The bounds of candidate points. + * **random_state** (*RandomState*) – Random number generator. + * **sampler** (*str*) – Sampler generating warmup points. “uniform” or “lhs”. + * **n_warmup** (*int*) – Number of randomly sampled points to select the initial + point for minimization. ## maml.apps.bowsr.optimizer module @@ -184,9 +125,8 @@ Bayesian optimizer used to optimize the structure. Add query point into the TargetSpace. - * **Parameters** -**x** (*ndarray*) – Query point. + **x** (*ndarray*) – Query point. #### as_dict() @@ -197,17 +137,15 @@ Dict representation of BayesianOptimizer. Reconstitute a BayesianOptimizer object from a dict representation of BayesianOptimizer created using as_dict(). - * **Parameters** -**d** (*dict*) – Dict representation of BayesianOptimizer. + **d** (*dict*) – Dict representation of BayesianOptimizer. #### get_derived_structure(x: ndarray) Get the derived structure. - * **Parameters** -**x** (*ndarray*) – The input of getting perturbed structure. + **x** (*ndarray*) – The input of getting perturbed structure. #### get_formation_energy(x: ndarray) @@ -215,16 +153,14 @@ Calculate the formation energy of the perturbed structure. Absolute value is calculated on practical purpose of maximization of target function in Bayesian optimization. - * **Parameters** -**x** (*ndarray*) – The input of formation energy calculation. + **x** (*ndarray*) – The input of formation energy calculation. #### get_optimized_structure_and_energy(cutoff_distance: float = 1.1) - * **Parameters** -**cutoff_distance** (*float*) – Cutoff distance of the allowed shortest atomic distance in reasonable structures. -When the cutoff_distance is 0, any structures will be considered reasonable. + **cutoff_distance** (*float*) – Cutoff distance of the allowed shortest atomic distance in reasonable structures. + When the cutoff_distance is 0, any structures will be considered reasonable. #### *property* gpr() @@ -236,54 +172,30 @@ Optimize the coordinates and/or lattice of the structure by minimizing the model predicted formation energy of the structure. Model prediction error can be considered as a constant white noise. - * **Parameters** - - * **n_init** (*int*) – The number of initial points. - - - * **n_iter** (*int*) – The number of iteration steps. - - - * **acq_type** (*str*) – The type of acquisition function. Three choices are given, -ucb: Upper confidence bound, -ei: Expected improvement, -poi: Probability of improvement. - - - * **kappa** (*float*) – Tradeoff parameter used in upper confidence bound formulism. - - - * **xi** (*float*) – Tradeoff parameter between exploitation and exploration. - - - * **n_warmup** (*int*) – Number of randomly sampled points to select the initial -point for minimization. - - - * **is_continue** (*bool*) – whether to continue previous run without resetting GPR - - - * **sampler** (*str*) – Sampler generating initial points. “uniform” or “lhs”. - - - * **\*\*gpr_params** – Passthrough. + * **n_init** (*int*) – The number of initial points. + * **n_iter** (*int*) – The number of iteration steps. + * **acq_type** (*str*) – The type of acquisition function. Three choices are given, + ucb: Upper confidence bound, + ei: Expected improvement, + poi: Probability of improvement. + * **kappa** (*float*) – Tradeoff parameter used in upper confidence bound formulism. + * **xi** (*float*) – Tradeoff parameter between exploitation and exploration. + * **n_warmup** (*int*) – Number of randomly sampled points to select the initial + point for minimization. + * **is_continue** (*bool*) – whether to continue previous run without resetting GPR + * **sampler** (*str*) – Sampler generating initial points. “uniform” or “lhs”. + * **\*\*gpr_params** – Passthrough. #### propose(acquisition_function: AcquisitionFunction, n_warmup: int, sampler: str) Suggest the next most promising point. - * **Parameters** - - * **acquisition_function** (*AcquisitionFunction*) – AcquisitionFunction. - - - * **n_warmup** (*int*) – Number of randomly sampled points to select the initial -point for minimization. - - - * **sampler** (*str*) – Sampler. Options are Latin Hyperparameter Sampling and uniform sampling. + * **acquisition_function** (*AcquisitionFunction*) – AcquisitionFunction. + * **n_warmup** (*int*) – Number of randomly sampled points to select the initial + point for minimization. + * **sampler** (*str*) – Sampler. Options are Latin Hyperparameter Sampling and uniform sampling. #### set_bounds(\*\*bounds_parameter) @@ -305,42 +217,24 @@ Returns the target space. Identify whether structure is unreasonable because the atoms are “too close”. - * **Parameters** - - * **structure** (*Structure*) – Pymatgen Structure object. - - - * **cutoff_distance** (*float*) – The minimum allowed atomic distance. + * **structure** (*Structure*) – Pymatgen Structure object. + * **cutoff_distance** (*float*) – The minimum allowed atomic distance. ### maml.apps.bowsr.optimizer.struct2perturbation(structure: Structure, use_symmetry: bool = True, wyc_tol: float = 0.0003, abc_tol: float = 0.001, angle_tol: float = 0.2, symprec: float = 0.01) Get the symmetry-driven perturbation of the structure. - * **Parameters** - - * **structure** (*Structure*) – Pymatgen Structure object. - - - * **use_symmetry** (*bool*) – Whether to use constraint of symmetry to reduce -parameters space. - - - * **wyc_tol** (*float*) – Tolerance for wyckoff symbol determined coordinates. - - - * **abc_tol** (*float*) – Tolerance for lattice lengths determined by crystal system. - - - * **angle_tol** (*float*) – Tolerance for lattice angles determined by crystal system. - - - * **symprec** (*float*) – Tolerance for symmetry finding. - - + * **structure** (*Structure*) – Pymatgen Structure object. + * **use_symmetry** (*bool*) – Whether to use constraint of symmetry to reduce + parameters space. + * **wyc_tol** (*float*) – Tolerance for wyckoff symbol determined coordinates. + * **abc_tol** (*float*) – Tolerance for lattice lengths determined by crystal system. + * **angle_tol** (*float*) – Tolerance for lattice angles determined by crystal system. + * **symprec** (*float*) – Tolerance for symmetry finding. * **Returns** -WyckoffPerturbations for derivation of symmetrically + WyckoffPerturbations for derivation of symmetrically ```none unique sites. Used to derive the coordinates of the sites. @@ -357,9 +251,8 @@ lp (LatticePerturbation): LatticePerturbation for derivation of lattice of the structure. ``` - * **Return type** -wps (list) + wps (list) ## maml.apps.bowsr.perturbation module @@ -387,16 +280,10 @@ Returns the lattice. Check whether the perturbation mode exists. - * **Parameters** - - * **lattice** (*Lattice*) – Lattice in Structure. - - - * **abc_tol** (*float*) – Tolerance for lattice lengths determined by crystal system. - - - * **angle_tol** (*float*) – Tolerance for lattice angles determined by crystal system. + * **lattice** (*Lattice*) – Lattice in Structure. + * **abc_tol** (*float*) – Tolerance for lattice lengths determined by crystal system. + * **angle_tol** (*float*) – Tolerance for lattice angles determined by crystal system. ### *class* maml.apps.bowsr.perturbation.WyckoffPerturbation(int_symbol: int, wyckoff_symbol: str, symmetry_ops: list[SymmOp] | None = None, use_symmetry: bool = True) @@ -413,25 +300,17 @@ Returns whether the site fits any standard wyckoff position. Returns the orbit for a point. - * **Parameters** - - * **p** (*list/numpy.array*) – Fractional coordinated point. - - - * **tol** (*float*) – Tolerance for determining if sites are the same. + * **p** (*list/numpy.array*) – Fractional coordinated point. + * **tol** (*float*) – Tolerance for determining if sites are the same. #### sanity_check(site: Site | PeriodicSite, wyc_tol: float = 0.0003) Check whether the perturbation mode exists. - * **Parameters** - - * **site** (*PeriodicSite*) – PeriodicSite in Structure. - - - * **wyc_tol** (*float*) – Tolerance for wyckoff symbol determined coordinates. + * **site** (*PeriodicSite*) – PeriodicSite in Structure. + * **wyc_tol** (*float*) – Tolerance for wyckoff symbol determined coordinates. #### *property* site() @@ -441,41 +320,31 @@ Returns the site. Get the standardized position of p. - * **Parameters** - - * **p** (*list/numpy.array*) – Fractional coordinated point. - - - * **tol** (*float*) – Tolerance for determining if sites are the same. + * **p** (*list/numpy.array*) – Fractional coordinated point. + * **tol** (*float*) – Tolerance for determining if sites are the same. ### maml.apps.bowsr.perturbation.crystal_system(int_number: int) Method for crystal system determination. - * **Parameters** -**int_number** (*int*) – International number of space group. + **int_number** (*int*) – International number of space group. ### maml.apps.bowsr.perturbation.get_standardized_structure(structure: Structure) Get standardized structure. - * **Parameters** -**structure** (*Structure*) – Pymatgen Structure object. + **structure** (*Structure*) – Pymatgen Structure object. ### maml.apps.bowsr.perturbation.perturbation_mapping(x, fixed_indices) Perturbation mapping. - * **Parameters** - - * **x** – - - - * **fixed_indices** – + * **x** – + * **fixed_indices** – Returns: @@ -498,10 +367,9 @@ Returns: Fit the DummyScaler to the target. - * **Parameters** -**target** (*ndarray*) – The (mxn) ndarray. m is the number of samples, -n is the number of feature dimensions. + **target** (*ndarray*) – The (mxn) ndarray. m is the number of samples, + n is the number of feature dimensions. #### *classmethod* from_dict(d) @@ -514,19 +382,17 @@ Returns: Inversely transform the target. - * **Parameters** -**transformed_target** (*ndarray*) – The (mxn) ndarray. m is the number of samples, -n is the number of feature dimensions. + **transformed_target** (*ndarray*) – The (mxn) ndarray. m is the number of samples, + n is the number of feature dimensions. #### transform(target: list | np.ndarray) Transform target. - * **Parameters** -**target** (*ndarray*) – The (mxn) ndarray. m is the number of samples, -n is the number of feature dimensions. + **target** (*ndarray*) – The (mxn) ndarray. m is the number of samples, + n is the number of feature dimensions. ### *class* maml.apps.bowsr.preprocessing.StandardScaler(mean: list | np.ndarray | None = None, std: list | np.ndarray | None = None) @@ -543,37 +409,33 @@ Dict representation of StandardScaler. Fit the StandardScaler to the target. - * **Parameters** -**target** (*ndarray*) – The (mxn) ndarray. m is the number of samples, -n is the number of feature dimensions. + **target** (*ndarray*) – The (mxn) ndarray. m is the number of samples, + n is the number of feature dimensions. #### *classmethod* from_dict(d) Reconstitute a StandardScaler object from a dict representation of StandardScaler created using as_dict(). - * **Parameters** -**d** (*dict*) – Dict representation of StandardScaler. + **d** (*dict*) – Dict representation of StandardScaler. #### inverse_transform(transformed_target: ndarray) Inversely transform the target. - * **Parameters** -**transformed_target** (*ndarray*) – The (mxn) ndarray. m is the number of samples, -n is the number of feature dimensions. + **transformed_target** (*ndarray*) – The (mxn) ndarray. m is the number of samples, + n is the number of feature dimensions. #### transform(target: ndarray) Transform target according to the mean and std. - * **Parameters** -**target** (*ndarray*) – The (mxn) ndarray. m is the number of samples, -n is the number of feature dimensions. + **target** (*ndarray*) – The (mxn) ndarray. m is the number of samples, + n is the number of feature dimensions. ## maml.apps.bowsr.target_space module @@ -595,9 +457,8 @@ Returns the search space of parameters. Latin hypercube sampling. - * **Parameters** -**n_intervals** (*int*) – Number of intervals. + **n_intervals** (*int*) – Number of intervals. #### *property* params(*: ndarra* ) @@ -608,21 +469,16 @@ Returns the parameters in target space. Evaluate a single point x, to obtain the value y and then records them as observations. - * **Parameters** -**x** (*ndarray*) – A single point. + **x** (*ndarray*) – A single point. #### register(x, target) Append a point and its target value to the known data. - * **Parameters** - - * **x** (*ndarray*) – A single query point. - - - * **target** (*float*) – Target value. + * **x** (*ndarray*) – A single query point. + * **target** (*float*) – Target value. #### set_bounds(abc_bound: float = 1.2, angles_bound: float = 5, element_wise_wyckoff_bounds: dict | None = None) diff --git a/docs/maml.apps.bowsr.model.md b/docs/maml.apps.bowsr.model.md index 9aac2fca..9f998d90 100644 --- a/docs/maml.apps.bowsr.model.md +++ b/docs/maml.apps.bowsr.model.md @@ -58,9 +58,8 @@ DFT static calculation wrapped as energy model. Predict energy from structure. - * **Parameters** -**structure** – (pymatgen Structure). + **structure** – (pymatgen Structure). Returns: float diff --git a/docs/maml.apps.gbe.md b/docs/maml.apps.gbe.md index e53c869b..e81074f2 100644 --- a/docs/maml.apps.gbe.md +++ b/docs/maml.apps.gbe.md @@ -25,38 +25,26 @@ Available algorithms: GBBond.NNDict.keys(), default CrystalNN. #### NNDict(_ = {‘brunnernn_real’: , ‘brunnernn_reciprocal’: , ‘brunnernn_relative’: , ‘covalentbondnn’: , ‘critic2nn’: , ‘crystalnn’: , ‘cutoffdictnn’: , ‘econnn’: , ‘jmolnn’: , ‘minimumdistancenn’: , ‘minimumokeeffenn’: , ‘minimumvirenn’: , ‘nearneighbors’: , ‘openbabelnn’: , ‘voronoinn’: _ ) -#### _get_bond_mat(gb: GrainBoundary) - +#### \_get_bond_mat(gb: GrainBoundary) * **Parameters** -**gb** (*GrainBoundary*) – the grain boundary structure object. - - + **gb** (*GrainBoundary*) – the grain boundary structure object. * **Returns** -bond matrix -matrix of bond lengths - - - 1. bm[i][j] = bond length between atom i&j -if i & j is bonded (determined by the loc_algo) - - - 2. bm[i][j] = bm[j][i] - - - 3. If not bonded, the bm[i][j] = np.nan + bond matrix + matrix of bond lengths + 1. bm[i][j] = bond length between atom i&j + if i & j is bonded (determined by the loc_algo) + 2. bm[i][j] = bm[j][i] + 3. If not bonded, the bm[i][j] = np.nan #### as_dict() Dict representation of the GBond class. - * **Returns** -str, “bond_mat”: bond matrix} - - + str, “bond_mat”: bond matrix} * **Return type** -dict of {“loc_algo” + dict of {“loc_algo” #### *property* bond_matrix(*: ndarra* ) @@ -64,13 +52,10 @@ The (padded) bond matrix. #### *classmethod* from_dict(d) - * **Parameters** -**d** (*dict*) – Dict representation. - - + **d** (*dict*) – Dict representation. * **Returns** -GBBond + GBBond #### get_breakbond_ratio(gb: GrainBoundary, b0: float, return_count: bool = False) @@ -80,29 +65,18 @@ The algo to find the bonds can vary Meme: if use get_neighbors, require a hard set cutoff, which adds to > arbitrariness. - - * **Parameters** - - * **gb** (*GrainBoundary*) – a GrainBoundary object - - - * **b0** (*float*) – cutoff to determine short vs. long bonds, -default the bulk bond length - - - * **return_count** (*bool*) – whether to return count of - - + * **gb** (*GrainBoundary*) – a GrainBoundary object + * **b0** (*float*) – cutoff to determine short vs. long bonds, + default the bulk bond length + * **return_count** (*bool*) – whether to return count of * **Returns** -shorter_bond / longer_bonds -if return_count: -shorter_bond: # of short bonds -longer_bond: # of long bonds - - + shorter_bond / longer_bonds + if return_count: + shorter_bond: # of short bonds + longer_bond: # of long bonds * **Return type** -ratio (float) + ratio (float) #### get_mean_bl_chg(b0: float) @@ -139,13 +113,10 @@ Generate the bulk reference for given gb entry :param inc_target: whether to include target. :type inc_target: bool - * **Returns** -data for bulk - - + data for bulk * **Return type** -bulk_df (pd.DataFrame) + bulk_df (pd.DataFrame) #### transform_one(db_entry: dict, inc_target: bool = True, inc_bulk_ref: bool = True, mp_api: str | None = None) @@ -157,14 +128,11 @@ Describe gb with selected structural and elemental features :param inc_bulk_ref: whether to generate bulk reference > bulk reference: i.e. the entry of the origin bulk of the GB, - > ```none > the rotation angle (theta) = 0, gb_energy = 0 > ``` - - * **Parameters** -**mp_api** (*str*) – MP api key. + **mp_api** (*str*) – MP api key. Returns: pd.DataFrame of processed data, columns are the feature labels @@ -180,9 +148,8 @@ four index notion to three index notion for hcp and rhombohedral axis :param lat_type: the :type lat_type: str - * **Returns** -rotation axis in three index notion. + rotation axis in three index notion. ### maml.apps.gbe.describer.convert_hcp_plane(plane: list) @@ -190,9 +157,8 @@ four index notion to three index notion for hcp and rhombohedral plane :param plane: four index notion. :type plane: list - * **Returns** -three index notion of plane + three index notion of plane ### maml.apps.gbe.describer.get_elemental_feature(db_entry: dict, loc_algo: str = ‘crystalnn’, features: list | None = None, mp_api: str | None = None) @@ -202,28 +168,25 @@ Function to get the elemental features :param loc_algo: algorithm to determine local env. > Options: see GBBond.NNDict.keys() - - * **Parameters** - - * **features** (*List*) – list of feature names -e_coh: cohesive energy -G: G_vrh shear modulus -a0: bulk lattice parameter a -ar: atomic radius -b0: the bond length of the metal bulk -mean_delta_bl: the mean bond length difference + * **features** (*List*) – list of feature names + e_coh: cohesive energy + G: G_vrh shear modulus + a0: bulk lattice parameter a + ar: atomic radius + b0: the bond length of the metal bulk + mean_delta_bl: the mean bond length difference > between GB and the bulk bl: the mean bond length in GB - - * **mp_api** (*str*) – api key to MP. - +```none +* **mp_api** (*str*) – api key to MP. +``` * **Returns** -pd.DataFrame of elemental features + pd.DataFrame of elemental features ### maml.apps.gbe.describer.get_structural_feature(db_entry: dict, features: list | None = None) @@ -235,17 +198,11 @@ d_rot: interplanal distance of the gb_plane theta: rotation angle (sin and cos). - * **Parameters** - - * **db_entry** (*Dict*) – db entry - - - * **features** (*List*) – list of features. - - + * **db_entry** (*Dict*) – db entry + * **features** (*List*) – list of features. * **Returns** -pd.DataFrame of structural features + pd.DataFrame of structural features ## maml.apps.gbe.presetfeatures module @@ -281,13 +238,10 @@ Module implements helper functions to retrieve data for GB energy prediction pap Helper function to retrieve the b0 data. b0 is the bulk bond length. - * **Returns** -b0} - - + b0} * **Return type** -returns the dict of {element + returns the dict of {element ### maml.apps.gbe.utils.load_data(filename: str | None = None) @@ -296,9 +250,8 @@ Default is to load the 361 data :param filename: the filename of the data. :type filename: str - * **Returns** -data list + data list ### maml.apps.gbe.utils.load_mean_delta_bl_dict(loc_algo: str = ‘crystalnn’) @@ -306,13 +259,10 @@ Helper function to load the mean_delta_bl data :param loc_algo: name of the algorithm. :type loc_algo: str - * **Returns** -mean_delta_bl(float)} - - + mean_delta_bl(float)} * **Return type** -{task_id (int) + {task_id (int) ### maml.apps.gbe.utils.update_b0_dict(data_source: list, mp_api: str | None) @@ -323,10 +273,7 @@ Requires api key to MP :param mp_api: API key to MP :type mp_api: str - * **Returns** -{el: b0}. - - + {el: b0}. * **Return type** -b0_dict (dict) \ No newline at end of file + b0_dict (dict) \ No newline at end of file diff --git a/docs/maml.apps.md b/docs/maml.apps.md index 50e9e6b9..b256d605 100644 --- a/docs/maml.apps.md +++ b/docs/maml.apps.md @@ -8,1373 +8,460 @@ nav_exclude: true ## Subpackages - * [maml.apps.bowsr package](maml.apps.bowsr.md) - - - * Subpackages - - - * [maml.apps.bowsr.model package](maml.apps.bowsr.model.md) - - - * `EnergyModel` - - - * `EnergyModel.predict_energy()` - - - * maml.apps.bowsr.model.base module - - - * `EnergyModel` - - - * `EnergyModel.predict_energy()` - - - * maml.apps.bowsr.model.cgcnn module - - - * maml.apps.bowsr.model.dft module - - - * `DFT` - - - * `DFT.predict_energy()` - - - * maml.apps.bowsr.model.megnet module - - - * maml.apps.bowsr.acquisition module - - - * `AcquisitionFunction` - - - * `AcquisitionFunction._ei()` - - - * `AcquisitionFunction._gpucb()` - - - * `AcquisitionFunction._poi()` - - - * `AcquisitionFunction._ucb()` - - - * `AcquisitionFunction.calculate()` - - - * `_trunc()` - - - * `ensure_rng()` - - - * `lhs_sample()` - - - * `predict_mean_std()` - - - * `propose_query_point()` - - - * maml.apps.bowsr.optimizer module - - - * `BayesianOptimizer` - - - * `BayesianOptimizer.add_query()` - - - * `BayesianOptimizer.as_dict()` - - - * `BayesianOptimizer.from_dict()` - - - * `BayesianOptimizer.get_derived_structure()` - - - * `BayesianOptimizer.get_formation_energy()` - - - * `BayesianOptimizer.get_optimized_structure_and_energy()` - - - * `BayesianOptimizer.gpr` - - - * `BayesianOptimizer.optimize()` - - - * `BayesianOptimizer.propose()` - - - * `BayesianOptimizer.set_bounds()` - - - * `BayesianOptimizer.set_gpr_params()` - - - * `BayesianOptimizer.set_space_empty()` - - - * `BayesianOptimizer.space` - - - * `atoms_crowded()` - - - * `struct2perturbation()` - - - * maml.apps.bowsr.perturbation module - - - * `LatticePerturbation` - - - * `LatticePerturbation.abc` - - - * `LatticePerturbation.fit_lattice` - - - * `LatticePerturbation.lattice` - - - * `LatticePerturbation.sanity_check()` - - - * `WyckoffPerturbation` - - - * `WyckoffPerturbation.fit_site` - - - * `WyckoffPerturbation.get_orbit()` - - - * `WyckoffPerturbation.sanity_check()` - - - * `WyckoffPerturbation.site` - - - * `WyckoffPerturbation.standardize()` - - - * `crystal_system()` - - - * `get_standardized_structure()` - - - * `perturbation_mapping()` - - - * maml.apps.bowsr.preprocessing module - - - * `DummyScaler` - - - * `DummyScaler.as_dict()` - - - * `DummyScaler.fit()` - - - * `DummyScaler.from_dict()` - - - * `DummyScaler.inverse_transform()` - - - * `DummyScaler.transform()` - - - * `StandardScaler` - - - * `StandardScaler.as_dict()` - - - * `StandardScaler.fit()` - - - * `StandardScaler.from_dict()` - - - * `StandardScaler.inverse_transform()` - - - * `StandardScaler.transform()` - - - * maml.apps.bowsr.target_space module - - - * `TargetSpace` - - - * `TargetSpace.bounds` - - - * `TargetSpace.lhs_sample()` - - - * `TargetSpace.params` - - - * `TargetSpace.probe()` - - - * `TargetSpace.register()` - - - * `TargetSpace.set_bounds()` - - - * `TargetSpace.set_empty()` - - - * `TargetSpace.target` - - - * `TargetSpace.uniform_sample()` - - - * `_hashable()` - - + * Subpackages + * [maml.apps.bowsr.model package](maml.apps.bowsr.model.md) + * `EnergyModel` + * `EnergyModel.predict_energy()` + * maml.apps.bowsr.model.base module + * `EnergyModel` + * `EnergyModel.predict_energy()` + * maml.apps.bowsr.model.cgcnn module + * maml.apps.bowsr.model.dft module + * `DFT` + * `DFT.predict_energy()` + * maml.apps.bowsr.model.megnet module + * maml.apps.bowsr.acquisition module + * `AcquisitionFunction` + * `AcquisitionFunction._ei()` + * `AcquisitionFunction._gpucb()` + * `AcquisitionFunction._poi()` + * `AcquisitionFunction._ucb()` + * `AcquisitionFunction.calculate()` + * `_trunc()` + * `ensure_rng()` + * `lhs_sample()` + * `predict_mean_std()` + * `propose_query_point()` + * maml.apps.bowsr.optimizer module + * `BayesianOptimizer` + * `BayesianOptimizer.add_query()` + * `BayesianOptimizer.as_dict()` + * `BayesianOptimizer.from_dict()` + * `BayesianOptimizer.get_derived_structure()` + * `BayesianOptimizer.get_formation_energy()` + * `BayesianOptimizer.get_optimized_structure_and_energy()` + * `BayesianOptimizer.gpr` + * `BayesianOptimizer.optimize()` + * `BayesianOptimizer.propose()` + * `BayesianOptimizer.set_bounds()` + * `BayesianOptimizer.set_gpr_params()` + * `BayesianOptimizer.set_space_empty()` + * `BayesianOptimizer.space` + * `atoms_crowded()` + * `struct2perturbation()` + * maml.apps.bowsr.perturbation module + * `LatticePerturbation` + * `LatticePerturbation.abc` + * `LatticePerturbation.fit_lattice` + * `LatticePerturbation.lattice` + * `LatticePerturbation.sanity_check()` + * `WyckoffPerturbation` + * `WyckoffPerturbation.fit_site` + * `WyckoffPerturbation.get_orbit()` + * `WyckoffPerturbation.sanity_check()` + * `WyckoffPerturbation.site` + * `WyckoffPerturbation.standardize()` + * `crystal_system()` + * `get_standardized_structure()` + * `perturbation_mapping()` + * maml.apps.bowsr.preprocessing module + * `DummyScaler` + * `DummyScaler.as_dict()` + * `DummyScaler.fit()` + * `DummyScaler.from_dict()` + * `DummyScaler.inverse_transform()` + * `DummyScaler.transform()` + * `StandardScaler` + * `StandardScaler.as_dict()` + * `StandardScaler.fit()` + * `StandardScaler.from_dict()` + * `StandardScaler.inverse_transform()` + * `StandardScaler.transform()` + * maml.apps.bowsr.target_space module + * `TargetSpace` + * `TargetSpace.bounds` + * `TargetSpace.lhs_sample()` + * `TargetSpace.params` + * `TargetSpace.probe()` + * `TargetSpace.register()` + * `TargetSpace.set_bounds()` + * `TargetSpace.set_empty()` + * `TargetSpace.target` + * `TargetSpace.uniform_sample()` + * `_hashable()` * [maml.apps.gbe package](maml.apps.gbe.md) - - - * maml.apps.gbe.describer module - - - * `GBBond` - - - * `GBBond.NNDict` - - - * `GBBond._get_bond_mat()` - - - * `GBBond.as_dict()` - - - * `GBBond.bond_matrix` - - - * `GBBond.from_dict()` - - - * `GBBond.get_breakbond_ratio()` - - - * `GBBond.get_mean_bl_chg()` - - - * `GBBond.max_bl` - - - * `GBBond.min_bl` - - - * `GBDescriber` - - - * `GBDescriber._abc_impl` - - - * `GBDescriber._sklearn_auto_wrap_output_keys` - - - * `GBDescriber.generate_bulk_ref()` - - - * `GBDescriber.transform_one()` - - - * `convert_hcp_direction()` - - - * `convert_hcp_plane()` - - - * `get_elemental_feature()` - - - * `get_structural_feature()` - - - * maml.apps.gbe.presetfeatures module - - - * `my_quant` - - - * `my_quant.latex` - - - * `my_quant.name` - - - * `my_quant.unit` - - - * maml.apps.gbe.utils module - - - * `load_b0_dict()` - - - * `load_data()` - - - * `load_mean_delta_bl_dict()` - - - * `update_b0_dict()` - - + * maml.apps.gbe.describer module + * `GBBond` + * `GBBond.NNDict` + * `GBBond._get_bond_mat()` + * `GBBond.as_dict()` + * `GBBond.bond_matrix` + * `GBBond.from_dict()` + * `GBBond.get_breakbond_ratio()` + * `GBBond.get_mean_bl_chg()` + * `GBBond.max_bl` + * `GBBond.min_bl` + * `GBDescriber` + * `GBDescriber._abc_impl` + * `GBDescriber._sklearn_auto_wrap_output_keys` + * `GBDescriber.generate_bulk_ref()` + * `GBDescriber.transform_one()` + * `convert_hcp_direction()` + * `convert_hcp_plane()` + * `get_elemental_feature()` + * `get_structural_feature()` + * maml.apps.gbe.presetfeatures module + * `my_quant` + * `my_quant.latex` + * `my_quant.name` + * `my_quant.unit` + * maml.apps.gbe.utils module + * `load_b0_dict()` + * `load_data()` + * `load_mean_delta_bl_dict()` + * `update_b0_dict()` * [maml.apps.pes package](maml.apps.pes.md) - - + * `DefectFormation` + * `DefectFormation._parse()` + * `DefectFormation._sanity_check()` + * `DefectFormation._setup()` + * `DefectFormation.calculate()` + * `DefectFormation.get_unit_cell()` + * `ElasticConstant` + * `ElasticConstant._RESTART_CONFIG` + * `ElasticConstant._parse()` + * `ElasticConstant._sanity_check()` + * `ElasticConstant._setup()` + * `EnergyForceStress` + * `EnergyForceStress._parse()` + * `EnergyForceStress._rotate_force_stress()` + * `EnergyForceStress._sanity_check()` + * `EnergyForceStress._setup()` + * `EnergyForceStress.calculate()` + * `GAPotential` + * `GAPotential._abc_impl` + * `GAPotential._line_up()` + * `GAPotential.evaluate()` + * `GAPotential.from_config()` + * `GAPotential.pair_coeff` + * `GAPotential.pair_style` + * `GAPotential.read_cfgs()` + * `GAPotential.save()` + * `GAPotential.train()` + * `GAPotential.write_cfgs()` + * `GAPotential.write_param()` + * `LMPStaticCalculator` + * `LMPStaticCalculator._COMMON_CMDS` + * `LMPStaticCalculator._parse()` + * `LMPStaticCalculator._sanity_check()` + * `LMPStaticCalculator._setup()` + * `LMPStaticCalculator.allowed_kwargs` + * `LMPStaticCalculator.calculate()` + * `LMPStaticCalculator.set_lmp_exe()` + * `LatticeConstant` + * `LatticeConstant.calculate()` + * `MTPotential` + * `MTPotential._abc_impl` + * `MTPotential._line_up()` + * `MTPotential.evaluate()` + * `MTPotential.from_config()` + * `MTPotential.pair_coeff` + * `MTPotential.pair_style` + * `MTPotential.read_cfgs()` + * `MTPotential.train()` + * `MTPotential.write_cfg()` + * `MTPotential.write_ini()` + * `MTPotential.write_param()` + * `NNPotential` + * `NNPotential._abc_impl` + * `NNPotential._line_up()` + * `NNPotential.bohr_to_angstrom` + * `NNPotential.eV_to_Ha` + * `NNPotential.evaluate()` + * `NNPotential.from_config()` + * `NNPotential.load_input()` + * `NNPotential.load_scaler()` + * `NNPotential.load_weights()` + * `NNPotential.pair_coeff` + * `NNPotential.pair_style` + * `NNPotential.read_cfgs()` + * `NNPotential.train()` + * `NNPotential.write_cfgs()` + * `NNPotential.write_input()` + * `NNPotential.write_param()` + * `NudgedElasticBand` + * `NudgedElasticBand._parse()` + * `NudgedElasticBand._sanity_check()` + * `NudgedElasticBand._setup()` + * `NudgedElasticBand.calculate()` + * `NudgedElasticBand.get_unit_cell()` + * `Potential` + * `SNAPotential` + * `SNAPotential._abc_impl` + * `SNAPotential.evaluate()` + * `SNAPotential.from_config()` + * `SNAPotential.pair_coeff` + * `SNAPotential.pair_style` + * `SNAPotential.train()` + * `SNAPotential.write_param()` + * `SpectralNeighborAnalysis` + * `SpectralNeighborAnalysis._CMDS` + * `SpectralNeighborAnalysis._parse()` + * `SpectralNeighborAnalysis._sanity_check()` + * `SpectralNeighborAnalysis._setup()` + * `SpectralNeighborAnalysis.get_bs_subscripts()` + * `SpectralNeighborAnalysis.n_bs` + * `get_default_lmp_exe()` + * maml.apps.pes._base module + * `Potential` + * `PotentialMixin` + * `PotentialMixin.evaluate()` + * `PotentialMixin.from_config()` + * `PotentialMixin.predict_efs()` + * `PotentialMixin.train()` + * `PotentialMixin.write_param()` + * maml.apps.pes._gap module + * `GAPotential` + * `GAPotential._abc_impl` + * `GAPotential._line_up()` + * `GAPotential.evaluate()` + * `GAPotential.from_config()` + * `GAPotential.pair_coeff` + * `GAPotential.pair_style` + * `GAPotential.read_cfgs()` + * `GAPotential.save()` + * `GAPotential.train()` + * `GAPotential.write_cfgs()` + * `GAPotential.write_param()` + * maml.apps.pes._lammps module * `DefectFormation` - - - * `DefectFormation._parse()` - - - * `DefectFormation._sanity_check()` - - - * `DefectFormation._setup()` - - - * `DefectFormation.calculate()` - - - * `DefectFormation.get_unit_cell()` - - + * `DefectFormation._parse()` + * `DefectFormation._sanity_check()` + * `DefectFormation._setup()` + * `DefectFormation.calculate()` + * `DefectFormation.get_unit_cell()` * `ElasticConstant` - - - * `ElasticConstant._RESTART_CONFIG` - - - * `ElasticConstant._parse()` - - - * `ElasticConstant._sanity_check()` - - - * `ElasticConstant._setup()` - - + * `ElasticConstant._RESTART_CONFIG` + * `ElasticConstant._parse()` + * `ElasticConstant._sanity_check()` + * `ElasticConstant._setup()` * `EnergyForceStress` - - - * `EnergyForceStress._parse()` - - - * `EnergyForceStress._rotate_force_stress()` - - - * `EnergyForceStress._sanity_check()` - - - * `EnergyForceStress._setup()` - - - * `EnergyForceStress.calculate()` - - - * `GAPotential` - - - * `GAPotential._abc_impl` - - - * `GAPotential._line_up()` - - - * `GAPotential.evaluate()` - - - * `GAPotential.from_config()` - - - * `GAPotential.pair_coeff` - - - * `GAPotential.pair_style` - - - * `GAPotential.read_cfgs()` - - - * `GAPotential.save()` - - - * `GAPotential.train()` - - - * `GAPotential.write_cfgs()` - - - * `GAPotential.write_param()` - - + * `EnergyForceStress._parse()` + * `EnergyForceStress._rotate_force_stress()` + * `EnergyForceStress._sanity_check()` + * `EnergyForceStress._setup()` + * `EnergyForceStress.calculate()` + * `LMPRelaxationCalculator` + * `LMPRelaxationCalculator._parse()` + * `LMPRelaxationCalculator._sanity_check()` + * `LMPRelaxationCalculator._setup()` * `LMPStaticCalculator` - - - * `LMPStaticCalculator._COMMON_CMDS` - - - * `LMPStaticCalculator._parse()` - - - * `LMPStaticCalculator._sanity_check()` - - - * `LMPStaticCalculator._setup()` - - - * `LMPStaticCalculator.allowed_kwargs` - - - * `LMPStaticCalculator.calculate()` - - - * `LMPStaticCalculator.set_lmp_exe()` - - + * `LMPStaticCalculator._COMMON_CMDS` + * `LMPStaticCalculator._parse()` + * `LMPStaticCalculator._sanity_check()` + * `LMPStaticCalculator._setup()` + * `LMPStaticCalculator.allowed_kwargs` + * `LMPStaticCalculator.calculate()` + * `LMPStaticCalculator.set_lmp_exe()` + * `LammpsPotential` + * `LammpsPotential._abc_impl` + * `LammpsPotential.predict_efs()` * `LatticeConstant` - - - * `LatticeConstant.calculate()` - - - * `MTPotential` - - - * `MTPotential._abc_impl` - - - * `MTPotential._line_up()` - - - * `MTPotential.evaluate()` - - - * `MTPotential.from_config()` - - - * `MTPotential.pair_coeff` - - - * `MTPotential.pair_style` - - - * `MTPotential.read_cfgs()` - - - * `MTPotential.train()` - - - * `MTPotential.write_cfg()` - - - * `MTPotential.write_ini()` - - - * `MTPotential.write_param()` - - - * `NNPotential` - - - * `NNPotential._abc_impl` - - - * `NNPotential._line_up()` - - - * `NNPotential.bohr_to_angstrom` - - - * `NNPotential.eV_to_Ha` - - - * `NNPotential.evaluate()` - - - * `NNPotential.from_config()` - - - * `NNPotential.load_input()` - - - * `NNPotential.load_scaler()` - - - * `NNPotential.load_weights()` - - - * `NNPotential.pair_coeff` - - - * `NNPotential.pair_style` - - - * `NNPotential.read_cfgs()` - - - * `NNPotential.train()` - - - * `NNPotential.write_cfgs()` - - - * `NNPotential.write_input()` - - - * `NNPotential.write_param()` - - + * `LatticeConstant.calculate()` * `NudgedElasticBand` - - - * `NudgedElasticBand._parse()` - - - * `NudgedElasticBand._sanity_check()` - - - * `NudgedElasticBand._setup()` - - - * `NudgedElasticBand.calculate()` - - - * `NudgedElasticBand.get_unit_cell()` - - - * `Potential` - - - * `SNAPotential` - - - * `SNAPotential._abc_impl` - - - * `SNAPotential.evaluate()` - - - * `SNAPotential.from_config()` - - - * `SNAPotential.pair_coeff` - - - * `SNAPotential.pair_style` - - - * `SNAPotential.train()` - - - * `SNAPotential.write_param()` - - + * `NudgedElasticBand._parse()` + * `NudgedElasticBand._sanity_check()` + * `NudgedElasticBand._setup()` + * `NudgedElasticBand.calculate()` + * `NudgedElasticBand.get_unit_cell()` * `SpectralNeighborAnalysis` - - - * `SpectralNeighborAnalysis._CMDS` - - - * `SpectralNeighborAnalysis._parse()` - - - * `SpectralNeighborAnalysis._sanity_check()` - - - * `SpectralNeighborAnalysis._setup()` - - - * `SpectralNeighborAnalysis.get_bs_subscripts()` - - - * `SpectralNeighborAnalysis.n_bs` - - + * `SpectralNeighborAnalysis._CMDS` + * `SpectralNeighborAnalysis._parse()` + * `SpectralNeighborAnalysis._sanity_check()` + * `SpectralNeighborAnalysis._setup()` + * `SpectralNeighborAnalysis.get_bs_subscripts()` + * `SpectralNeighborAnalysis.n_bs` + * `SurfaceEnergy` + * `SurfaceEnergy.calculate()` + * `_pretty_input()` + * `_read_dump()` * `get_default_lmp_exe()` - - - * maml.apps.pes._base module - - - * `Potential` - - - * `PotentialMixin` - - - * `PotentialMixin.evaluate()` - - - * `PotentialMixin.from_config()` - - - * `PotentialMixin.predict_efs()` - - - * `PotentialMixin.train()` - - - * `PotentialMixin.write_param()` - - - * maml.apps.pes._gap module - - - * `GAPotential` - - - * `GAPotential._abc_impl` - - - * `GAPotential._line_up()` - - - * `GAPotential.evaluate()` - - - * `GAPotential.from_config()` - - - * `GAPotential.pair_coeff` - - - * `GAPotential.pair_style` - - - * `GAPotential.read_cfgs()` - - - * `GAPotential.save()` - - - * `GAPotential.train()` - - - * `GAPotential.write_cfgs()` - - - * `GAPotential.write_param()` - - - * maml.apps.pes._lammps module - - - * `DefectFormation` - - - * `DefectFormation._parse()` - - - * `DefectFormation._sanity_check()` - - - * `DefectFormation._setup()` - - - * `DefectFormation.calculate()` - - - * `DefectFormation.get_unit_cell()` - - - * `ElasticConstant` - - - * `ElasticConstant._RESTART_CONFIG` - - - * `ElasticConstant._parse()` - - - * `ElasticConstant._sanity_check()` - - - * `ElasticConstant._setup()` - - - * `EnergyForceStress` - - - * `EnergyForceStress._parse()` - - - * `EnergyForceStress._rotate_force_stress()` - - - * `EnergyForceStress._sanity_check()` - - - * `EnergyForceStress._setup()` - - - * `EnergyForceStress.calculate()` - - - * `LMPRelaxationCalculator` - - - * `LMPRelaxationCalculator._parse()` - - - * `LMPRelaxationCalculator._sanity_check()` - - - * `LMPRelaxationCalculator._setup()` - - - * `LMPStaticCalculator` - - - * `LMPStaticCalculator._COMMON_CMDS` - - - * `LMPStaticCalculator._parse()` - - - * `LMPStaticCalculator._sanity_check()` - - - * `LMPStaticCalculator._setup()` - - - * `LMPStaticCalculator.allowed_kwargs` - - - * `LMPStaticCalculator.calculate()` - - - * `LMPStaticCalculator.set_lmp_exe()` - - - * `LammpsPotential` - - - * `LammpsPotential._abc_impl` - - - * `LammpsPotential.predict_efs()` - - - * `LatticeConstant` - - - * `LatticeConstant.calculate()` - - - * `NudgedElasticBand` - - - * `NudgedElasticBand._parse()` - - - * `NudgedElasticBand._sanity_check()` - - - * `NudgedElasticBand._setup()` - - - * `NudgedElasticBand.calculate()` - - - * `NudgedElasticBand.get_unit_cell()` - - - * `SpectralNeighborAnalysis` - - - * `SpectralNeighborAnalysis._CMDS` - - - * `SpectralNeighborAnalysis._parse()` - - - * `SpectralNeighborAnalysis._sanity_check()` - - - * `SpectralNeighborAnalysis._setup()` - - - * `SpectralNeighborAnalysis.get_bs_subscripts()` - - - * `SpectralNeighborAnalysis.n_bs` - - - * `SurfaceEnergy` - - - * `SurfaceEnergy.calculate()` - - - * `_pretty_input()` - - - * `_read_dump()` - - - * `get_default_lmp_exe()` - - - * maml.apps.pes._mtp module - - - * `MTPotential` - - - * `MTPotential._abc_impl` - - - * `MTPotential._line_up()` - - - * `MTPotential.evaluate()` - - - * `MTPotential.from_config()` - - - * `MTPotential.pair_coeff` - - - * `MTPotential.pair_style` - - - * `MTPotential.read_cfgs()` - - - * `MTPotential.train()` - - - * `MTPotential.write_cfg()` - - - * `MTPotential.write_ini()` - - - * `MTPotential.write_param()` - - - * `feed()` - - - * maml.apps.pes._nnp module - - - * `NNPotential` - - - * `NNPotential._abc_impl` - - - * `NNPotential._line_up()` - - - * `NNPotential.bohr_to_angstrom` - - - * `NNPotential.eV_to_Ha` - - - * `NNPotential.evaluate()` - - - * `NNPotential.from_config()` - - - * `NNPotential.load_input()` - - - * `NNPotential.load_scaler()` - - - * `NNPotential.load_weights()` - - - * `NNPotential.pair_coeff` - - - * `NNPotential.pair_style` - - - * `NNPotential.read_cfgs()` - - - * `NNPotential.train()` - - - * `NNPotential.write_cfgs()` - - - * `NNPotential.write_input()` - - - * `NNPotential.write_param()` - - - * maml.apps.pes._snap module - - - * `SNAPotential` - - - * `SNAPotential._abc_impl` - - - * `SNAPotential.evaluate()` - - - * `SNAPotential.from_config()` - - - * `SNAPotential.pair_coeff` - - - * `SNAPotential.pair_style` - - - * `SNAPotential.train()` - - - * `SNAPotential.write_param()` - - + * maml.apps.pes._mtp module + * `MTPotential` + * `MTPotential._abc_impl` + * `MTPotential._line_up()` + * `MTPotential.evaluate()` + * `MTPotential.from_config()` + * `MTPotential.pair_coeff` + * `MTPotential.pair_style` + * `MTPotential.read_cfgs()` + * `MTPotential.train()` + * `MTPotential.write_cfg()` + * `MTPotential.write_ini()` + * `MTPotential.write_param()` + * `feed()` + * maml.apps.pes._nnp module + * `NNPotential` + * `NNPotential._abc_impl` + * `NNPotential._line_up()` + * `NNPotential.bohr_to_angstrom` + * `NNPotential.eV_to_Ha` + * `NNPotential.evaluate()` + * `NNPotential.from_config()` + * `NNPotential.load_input()` + * `NNPotential.load_scaler()` + * `NNPotential.load_weights()` + * `NNPotential.pair_coeff` + * `NNPotential.pair_style` + * `NNPotential.read_cfgs()` + * `NNPotential.train()` + * `NNPotential.write_cfgs()` + * `NNPotential.write_input()` + * `NNPotential.write_param()` + * maml.apps.pes._snap module + * `SNAPotential` + * `SNAPotential._abc_impl` + * `SNAPotential.evaluate()` + * `SNAPotential.from_config()` + * `SNAPotential.pair_coeff` + * `SNAPotential.pair_style` + * `SNAPotential.train()` + * `SNAPotential.write_param()` * [maml.apps.symbolic package](maml.apps.symbolic.md) - - + * `AdaptiveLasso` + * `AdaptiveLasso._penalty_jac()` + * `AdaptiveLasso.get_w()` + * `AdaptiveLasso.penalty()` + * `AdaptiveLasso.select()` + * `DantzigSelector` + * `DantzigSelector.construct_constraints()` + * `DantzigSelector.construct_jac()` + * `DantzigSelector.construct_loss()` + * `FeatureGenerator` + * `FeatureGenerator.augment()` + * `ISIS` + * `ISIS.evaluate()` + * `ISIS.run()` + * `L0BrutalForce` + * `L0BrutalForce.select()` + * `Lasso` + * `Lasso._penalty_jac()` + * `Lasso.penalty()` + * `Operator` + * `Operator.compute()` + * `Operator.from_str()` + * `Operator.gen_name()` + * `Operator.is_binary` + * `Operator.is_commutative` + * `Operator.is_unary` + * `Operator.support_op_rep` + * `SCAD` + * `SCAD._penalty_jac()` + * `SCAD.penalty()` + * `SIS` + * `SIS.compute_residual()` + * `SIS.run()` + * `SIS.screen()` + * `SIS.select()` + * `SIS.set_gamma()` + * `SIS.set_selector()` + * `SIS.update_gamma()` + * maml.apps.symbolic._feature_generator module + * `FeatureGenerator` + * `FeatureGenerator.augment()` + * `Operator` + * `Operator.compute()` + * `Operator.from_str()` + * `Operator.gen_name()` + * `Operator.is_binary` + * `Operator.is_commutative` + * `Operator.is_unary` + * `Operator.support_op_rep` + * `_my_abs_diff()` + * `_my_abs_log10()` + * `_my_abs_sqrt()` + * `_my_abs_sum()` + * `_my_diff()` + * `_my_div()` + * `_my_exp()` + * `_my_exp_power_2()` + * `_my_exp_power_3()` + * `_my_mul()` + * `_my_power()` + * `_my_sum()` + * `_my_sum_exp()` + * `_my_sum_power_2()` + * `_my_sum_power_3()` + * `_update_df()` + * `generate_feature()` + * maml.apps.symbolic._selectors module * `AdaptiveLasso` - - - * `AdaptiveLasso._penalty_jac()` - - - * `AdaptiveLasso.get_w()` - - - * `AdaptiveLasso.penalty()` - - - * `AdaptiveLasso.select()` - - + * `AdaptiveLasso._penalty_jac()` + * `AdaptiveLasso.get_w()` + * `AdaptiveLasso.penalty()` + * `AdaptiveLasso.select()` + * `BaseSelector` + * `BaseSelector._get_param_names()` + * `BaseSelector.compute_residual()` + * `BaseSelector.construct_constraints()` + * `BaseSelector.construct_jac()` + * `BaseSelector.construct_loss()` + * `BaseSelector.evaluate()` + * `BaseSelector.get_coef()` + * `BaseSelector.get_feature_indices()` + * `BaseSelector.get_params()` + * `BaseSelector.predict()` + * `BaseSelector.select()` + * `BaseSelector.set_params()` * `DantzigSelector` - - - * `DantzigSelector.construct_constraints()` - - - * `DantzigSelector.construct_jac()` - - - * `DantzigSelector.construct_loss()` - - - * `FeatureGenerator` - - - * `FeatureGenerator.augment()` - - - * `ISIS` - - - * `ISIS.evaluate()` - - - * `ISIS.run()` - - + * `DantzigSelector.construct_constraints()` + * `DantzigSelector.construct_jac()` + * `DantzigSelector.construct_loss()` * `L0BrutalForce` - - - * `L0BrutalForce.select()` - - + * `L0BrutalForce.select()` * `Lasso` - - - * `Lasso._penalty_jac()` - - - * `Lasso.penalty()` - - - * `Operator` - - - * `Operator.compute()` - - - * `Operator.from_str()` - - - * `Operator.gen_name()` - - - * `Operator.is_binary` - - - * `Operator.is_commutative` - - - * `Operator.is_unary` - - - * `Operator.support_op_rep` - - + * `Lasso._penalty_jac()` + * `Lasso.penalty()` + * `PenalizedLeastSquares` + * `PenalizedLeastSquares._penalty_jac()` + * `PenalizedLeastSquares._sse_jac()` + * `PenalizedLeastSquares.construct_constraints()` + * `PenalizedLeastSquares.construct_jac()` + * `PenalizedLeastSquares.construct_loss()` + * `PenalizedLeastSquares.penalty()` * `SCAD` - - - * `SCAD._penalty_jac()` - - - * `SCAD.penalty()` - - + * `SCAD._penalty_jac()` + * `SCAD.penalty()` + * maml.apps.symbolic._selectors_cvxpy module + * `AdaptiveLassoCP` + * `AdaptiveLassoCP.get_w()` + * `AdaptiveLassoCP.penalty()` + * `AdaptiveLassoCP.select()` + * `BaseSelectorCP` + * `BaseSelectorCP.construct_constraints()` + * `BaseSelectorCP.construct_loss()` + * `BaseSelectorCP.select()` + * `DantzigSelectorCP` + * `DantzigSelectorCP.construct_constraints()` + * `DantzigSelectorCP.construct_loss()` + * `LassoCP` + * `LassoCP.penalty()` + * `PenalizedLeastSquaresCP` + * `PenalizedLeastSquaresCP.construct_loss()` + * `PenalizedLeastSquaresCP.penalty()` + * maml.apps.symbolic._sis module + * `ISIS` + * `ISIS.evaluate()` + * `ISIS.run()` * `SIS` - - - * `SIS.compute_residual()` - - - * `SIS.run()` - - - * `SIS.screen()` - - - * `SIS.select()` - - - * `SIS.set_gamma()` - - - * `SIS.set_selector()` - - - * `SIS.update_gamma()` - - - * maml.apps.symbolic._feature_generator module - - - * `FeatureGenerator` - - - * `FeatureGenerator.augment()` - - - * `Operator` - - - * `Operator.compute()` - - - * `Operator.from_str()` - - - * `Operator.gen_name()` - - - * `Operator.is_binary` - - - * `Operator.is_commutative` - - - * `Operator.is_unary` - - - * `Operator.support_op_rep` - - - * `_my_abs_diff()` - - - * `_my_abs_log10()` - - - * `_my_abs_sqrt()` - - - * `_my_abs_sum()` - - - * `_my_diff()` - - - * `_my_div()` - - - * `_my_exp()` - - - * `_my_exp_power_2()` - - - * `_my_exp_power_3()` - - - * `_my_mul()` - - - * `_my_power()` - - - * `_my_sum()` - - - * `_my_sum_exp()` - - - * `_my_sum_power_2()` - - - * `_my_sum_power_3()` - - - * `_update_df()` - - - * `generate_feature()` - - - * maml.apps.symbolic._selectors module - - - * `AdaptiveLasso` - - - * `AdaptiveLasso._penalty_jac()` - - - * `AdaptiveLasso.get_w()` - - - * `AdaptiveLasso.penalty()` - - - * `AdaptiveLasso.select()` - - - * `BaseSelector` - - - * `BaseSelector._get_param_names()` - - - * `BaseSelector.compute_residual()` - - - * `BaseSelector.construct_constraints()` - - - * `BaseSelector.construct_jac()` - - - * `BaseSelector.construct_loss()` - - - * `BaseSelector.evaluate()` - - - * `BaseSelector.get_coef()` - - - * `BaseSelector.get_feature_indices()` - - - * `BaseSelector.get_params()` - - - * `BaseSelector.predict()` - - - * `BaseSelector.select()` - - - * `BaseSelector.set_params()` - - - * `DantzigSelector` - - - * `DantzigSelector.construct_constraints()` - - - * `DantzigSelector.construct_jac()` - - - * `DantzigSelector.construct_loss()` - - - * `L0BrutalForce` - - - * `L0BrutalForce.select()` - - - * `Lasso` - - - * `Lasso._penalty_jac()` - - - * `Lasso.penalty()` - - - * `PenalizedLeastSquares` - - - * `PenalizedLeastSquares._penalty_jac()` - - - * `PenalizedLeastSquares._sse_jac()` - - - * `PenalizedLeastSquares.construct_constraints()` - - - * `PenalizedLeastSquares.construct_jac()` - - - * `PenalizedLeastSquares.construct_loss()` - - - * `PenalizedLeastSquares.penalty()` - - - * `SCAD` - - - * `SCAD._penalty_jac()` - - - * `SCAD.penalty()` - - - * maml.apps.symbolic._selectors_cvxpy module - - - * `AdaptiveLassoCP` - - - * `AdaptiveLassoCP.get_w()` - - - * `AdaptiveLassoCP.penalty()` - - - * `AdaptiveLassoCP.select()` - - - * `BaseSelectorCP` - - - * `BaseSelectorCP.construct_constraints()` - - - * `BaseSelectorCP.construct_loss()` - - - * `BaseSelectorCP.select()` - - - * `DantzigSelectorCP` - - - * `DantzigSelectorCP.construct_constraints()` - - - * `DantzigSelectorCP.construct_loss()` - - - * `LassoCP` - - - * `LassoCP.penalty()` - - - * `PenalizedLeastSquaresCP` - - - * `PenalizedLeastSquaresCP.construct_loss()` - - - * `PenalizedLeastSquaresCP.penalty()` - - - * maml.apps.symbolic._sis module - - - * `ISIS` - - - * `ISIS.evaluate()` - - - * `ISIS.run()` - - - * `SIS` - - - * `SIS.compute_residual()` - - - * `SIS.run()` - - - * `SIS.screen()` - - - * `SIS.select()` - - - * `SIS.set_gamma()` - - - * `SIS.set_selector()` - - - * `SIS.update_gamma()` - - - * `_best_combination()` - - - * `_eval()` - - - * `_get_coeff()` \ No newline at end of file + * `SIS.compute_residual()` + * `SIS.run()` + * `SIS.screen()` + * `SIS.select()` + * `SIS.set_gamma()` + * `SIS.set_selector()` + * `SIS.update_gamma()` + * `_best_combination()` + * `_eval()` + * `_get_coeff()` \ No newline at end of file diff --git a/docs/maml.apps.pes.md b/docs/maml.apps.pes.md index f7fa6bc7..c4a33a44 100644 --- a/docs/maml.apps.pes.md +++ b/docs/maml.apps.pes.md @@ -14,15 +14,15 @@ Bases: `LMPStaticCalculator` Defect formation energy calculator. -### _parse() +### \_parse() Parse results from dump files. -### _sanity_check(structure) +### \_sanity_check(structure) Check if the structure is valid for this calculation. -### _setup() +### \_setup() Setup a calculation, writing input files, etc. @@ -34,16 +34,10 @@ Calculate the vacancy formation given Potential class. Get the unit cell from specie, lattice type and lattice constant. - * **Parameters** - - * **specie** (*str*) – Name of specie. - - - * **lattice** (*str*) – The lattice type of structure. e.g. bcc or diamond. - - - * **alat** (*float*) – The lattice constant of specific lattice and specie. + * **specie** (*str*) – Name of specie. + * **lattice** (*str*) – The lattice type of structure. e.g. bcc or diamond. + * **alat** (*float*) – The lattice constant of specific lattice and specie. ## *class* maml.apps.pes.ElasticConstant(ff_settings, potential_type=’external’, deformation_size=1e-06, jiggle=1e-05, maxiter=400, maxeval=1000, full_matrix=False, \*\*kwargs) @@ -53,15 +47,15 @@ Elastic constant calculator. ### *RESTART_CONFIG(* = {‘external’: {‘read_command’: ‘read_restart’, ‘restart_file’: ‘restart.equil’, ‘write_command’: ‘write_restart’}, ‘internal’: {‘read_command’: ‘read_restart’, ‘restart_file’: ‘restart.equil’, ‘write_command’: ‘write_restart’}_ ) -### _parse() +### \_parse() Parse results from dump files. -### _sanity_check(structure) +### \_sanity_check(structure) Check if the structure is valid for this calculation. -### _setup() +### \_setup() Setup a calculation, writing input files, etc. @@ -71,17 +65,17 @@ Bases: `LMPStaticCalculator` Calculate energy, forces and virial stress of structures. -### _parse() +### \_parse() Parse results from dump files. -### *static* _rotate_force_stress(structure, forces, stresses) +### *static* \_rotate_force_stress(structure, forces, stresses) -### _sanity_check(structure) +### \_sanity_check(structure) Check if the structure is valid for this calculation. -### _setup() +### \_setup() Setup a calculation, writing input files, etc. @@ -91,9 +85,8 @@ Calculate the energy, forces and stresses of structures. Proper rotation of the results are applied when the structure is triclinic. - * **Parameters** -**structures** (*list*) – a list of structures + **structures** (*list*) – a list of structures Returns: list of (energy, forces, stresses) tuple @@ -105,26 +98,18 @@ This class implements Smooth Overlap of Atomic Position potentials. ### *abc_impl(* = <_abc.*abc_data object* ) -### *static* _line_up(structure, energy, forces, virial_stress) +### *static* \_line_up(structure, energy, forces, virial_stress) Convert input structure, energy, forces, virial_stress to proper configuration format for MLIP usage. - * **Parameters** - - * **structure** (*Structure*) – Pymatgen Structure object. - - - * **energy** (*float*) – DFT-calculated energy of the system. - - - * **forces** (*list*) – The forces should have dimension -(num_atoms, 3). - - - * **virial_stress** (*list*) – stress should has 6 distinct -elements arranged in order [xx, yy, zz, xy, yz, xz]. + * **structure** (*Structure*) – Pymatgen Structure object. + * **energy** (*float*) – DFT-calculated energy of the system. + * **forces** (*list*) – The forces should have dimension + (num_atoms, 3). + * **virial_stress** (*list*) – stress should has 6 distinct + elements arranged in order [xx, yy, zz, xy, yz, xz]. Returns: @@ -133,46 +118,29 @@ Returns: Evaluate energies, forces and stresses of structures with trained interatomic potentials. - * **Parameters** - - * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. - - - * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of -each structure in structures list. - - - * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of -each structure with m atoms in structures list. m can be varied -with each single structure case. - - - * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses -of each structure in structures list. - - - * **predict_energies** (*bool*) – Whether to predict energies of configurations. - - - * **predict_forces** (*bool*) – Whether to predict forces of configurations. - - - * **predict_stress** (*bool*) – Whether to predict virial stress of -configurations. + * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. + * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of + each structure in structures list. + * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of + each structure with m atoms in structures list. m can be varied + with each single structure case. + * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses + of each structure in structures list. + * **predict_energies** (*bool*) – Whether to predict energies of configurations. + * **predict_forces** (*bool*) – Whether to predict forces of configurations. + * **predict_stress** (*bool*) – Whether to predict virial stress of + configurations. ### *static* from_config(filename) Initialize potentials with parameters file. - * **Parameters** -**filename** (*str*) – The file storing parameters of potentials, -filename should ends with “.xml”. - - + **filename** (*str*) – The file storing parameters of potentials, + filename should ends with “.xml”. * **Returns** -GAPotential. + GAPotential. ### pair_coeff(_ = ‘pair_coeff \* \* {} {} {}_ ) @@ -182,64 +150,42 @@ GAPotential. Read the configuration file. - * **Parameters** -**filename** (*str*) – The configuration file to be read. + **filename** (*str*) – The configuration file to be read. ### save(filename=’param.yaml’) Save parameters of the potentials. - * **Parameters** -**filename** (*str*) – The file to store parameters of potentials. - - + **filename** (*str*) – The file to store parameters of potentials. * **Returns** -(str) + (str) ### train(train_structures, train_energies, train_forces, train_stresses=None, default_sigma=(0.0005, 0.1, 0.05, 0.01), use_energies=True, use_forces=True, use_stress=False, \*\*kwargs) Training data with gaussian process regression. - * **Parameters** - - * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. -energies ([float]): The list of total energies of each structure -in structures list. - - - * **train_energies** (*[**float**]*) – List of total energies of each structure in -structures list. - - - * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure -with m atoms in structures list. m can be varied with each -single structure case. - - - * **train_stresses** (*list*) – List of (6, ) virial stresses of each -structure in structures list. - - - * **default_sigma** (*list*) – Error criteria in energies, forces, stress -and hessian. Should have 4 numbers. - - - * **use_energies** (*bool*) – Whether to use dft total energies for training. -Default to True. - - - * **use_forces** (*bool*) – Whether to use dft atomic forces for training. -Default to True. - - - * **use_stress** (*bool*) – Whether to use dft virial stress for training. -Default to False. - - - * **kwargs** – l_max (int): Parameter to configure GAP. The band limit of + * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. + energies ([float]): The list of total energies of each structure + in structures list. + * **train_energies** (*[**float**]*) – List of total energies of each structure in + structures list. + * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure + with m atoms in structures list. m can be varied with each + single structure case. + * **train_stresses** (*list*) – List of (6, ) virial stresses of each + structure in structures list. + * **default_sigma** (*list*) – Error criteria in energies, forces, stress + and hessian. Should have 4 numbers. + * **use_energies** (*bool*) – Whether to use dft total energies for training. + Default to True. + * **use_forces** (*bool*) – Whether to use dft atomic forces for training. + Default to True. + * **use_stress** (*bool*) – Whether to use dft virial stress for training. + Default to False. + * **kwargs** – l_max (int): Parameter to configure GAP. The band limit of spherical harmonics basis function. Default to 12. @@ -327,22 +273,17 @@ e0_offset (float): Offset of baseline. If zero, the offset is Write the formatted configuration file. - * **Parameters** - - * **filename** (*str*) – The filename to be written. - - - * **cfg_pool** (*list*) – The configuration pool contains -structure and energy/forces properties. + * **filename** (*str*) – The filename to be written. + * **cfg_pool** (*list*) – The configuration pool contains + structure and energy/forces properties. ### write_param(xml_filename=’gap.2020.01.xml’) Write xml file to perform lammps calculation. - * **Parameters** -**xml_filename** (*str*) – Filename to store xml formatted parameters. + **xml_filename** (*str*) – Filename to store xml formatted parameters. ## *class* maml.apps.pes.LMPStaticCalculator(\*\*kwargs) @@ -353,15 +294,15 @@ using LAMMPS. ### *COMMON_CMDS(* = [‘units metal’, ‘atom_style charge’, ‘box tilt large’, ‘read_data data.static’, ‘run 0’_ ) -### *abstract* _parse() +### *abstract* \_parse() Parse results from dump files. -### *abstract* _sanity_check(structure) +### *abstract* \_sanity_check(structure) Check if the structure is valid for this calculation. -### *abstract* _setup() +### *abstract* \_setup() Setup a calculation, writing input files, etc. @@ -371,22 +312,18 @@ Setup a calculation, writing input files, etc. Perform the calculation on a series of structures. - * **Parameters** -**structures** – Input structures in a list. - - + **structures** – Input structures in a list. * **Returns** -List of computed data corresponding to each structure, -varies with different subclasses. + List of computed data corresponding to each structure, + varies with different subclasses. ### set_lmp_exe(lmp_exe: str) Set lammps executable for the instance. - * **Parameters** -**lmp_exe** (*str*) – lammps executable path + **lmp_exe** (*str*) – lammps executable path Returns: @@ -400,13 +337,10 @@ Lattice Constant Relaxation Calculator. Calculate the relaxed lattice parameters of a list of structures. - * **Parameters** -**structures** (*[**Structure**]*) – Input structures in a list. - - + **structures** (*[**Structure**]*) – Input structures in a list. * **Returns** -List of relaxed lattice constants (a, b, c in Å) of the input structures. + List of relaxed lattice constants (a, b, c in Å) of the input structures. ## *class* maml.apps.pes.MTPotential(name=None, param=None, version=None) @@ -418,68 +352,44 @@ Please refer to [https://mlip.skoltech.ru](https://mlip.skoltech.ru). ### *abc_impl(* = <_abc.*abc_data object* ) -### _line_up(structure, energy, forces, virial_stress) +### \_line_up(structure, energy, forces, virial_stress) Convert input structure, energy, forces, virial_stress to proper configuration format for mlip usage. - * **Parameters** - - * **structure** (*Structure*) – Pymatgen Structure object. - - - * **energy** (*float*) – DFT-calculated energy of the system. - - - * **forces** (*list*) – The forces should have dimension (num_atoms, 3). - - - * **virial_stress** (*list*) – stress should has 6 distinct -elements arranged in order [xx, yy, zz, yz, xz, xy]. + * **structure** (*Structure*) – Pymatgen Structure object. + * **energy** (*float*) – DFT-calculated energy of the system. + * **forces** (*list*) – The forces should have dimension (num_atoms, 3). + * **virial_stress** (*list*) – stress should has 6 distinct + elements arranged in order [xx, yy, zz, yz, xz, xy]. ### evaluate(test_structures, test_energies, test_forces, test_stresses=None, \*\*kwargs) Evaluate energies, forces and stresses of structures with trained interatomic potentials. - * **Parameters** - - * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. - - - * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of -each structure in structures list. - - - * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of -each structure with m atoms in structures list. m can be varied -with each single structure case. - - - * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses -of each structure in structures list. - - - * **kwargs** – Parameters of write_param method. + * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. + * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of + each structure in structures list. + * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of + each structure with m atoms in structures list. m can be varied + with each single structure case. + * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses + of each structure in structures list. + * **kwargs** – Parameters of write_param method. ### *static* from_config(filename, elements) Initialize potentials with parameters file. - * **Parameters** - - * **filename** (*str*) – The file storing parameters of potentials, filename should -ends with “.mtp”. - - - * **elements** (*list*) – The list of elements. - - + * **filename** (*str*) – The file storing parameters of potentials, filename should + ends with “.mtp”. + * **elements** (*list*) – The list of elements. * **Returns** -MTPotential + MTPotential ### pair_coeff(_ = ‘pair_coeff \* \*_ ) @@ -487,71 +397,40 @@ MTPotential ### read_cfgs(filename) - * **Parameters** -**filename** (*str*) – The configuration file to be read. + **filename** (*str*) – The configuration file to be read. ### train(train_structures, train_energies, train_forces, train_stresses, unfitted_mtp=’08g.mtp’, max_dist=5, radial_basis_size=8, max_iter=1000, energy_weight=1, force_weight=0.01, stress_weight=0.001, init_params=’same’, scale_by_force=0, bfgs_conv_tol=0.001, weighting=’vibration’) Training data with moment tensor method. - * **Parameters** - - * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. -energies ([float]): The list of total energies of each structure -in structures list. - - - * **train_energies** (*[**float**]*) – List of total energies of each structure in -structures list. - - - * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure -with m atoms in structures list. m can be varied with each single -structure case. - - - * **train_stresses** (*list*) – List of (6, ) virial stresses of each structure -in structures list. - - - * **unfitted_mtp** (*str*) – Define the initial mtp file. Default to the mtp file -stored in .params directory. - - - * **max_dist** (*float*) – The actual radial cutoff. - - - * **radial_basis_size** (*int*) – Relevant to number of radial basis function. - - - * **max_iter** (*int*) – The number of maximum iteration. - - - * **energy_weight** (*float*) – The weight of energy. - - - * **force_weight** (*float*) – The weight of forces. - - - * **stress_weight** (*float*) – The weight of stresses. Zero-weight can be assigned. - - - * **init_params** (*str*) – How to initialize parameters if a potential was not -pre-fitted. Choose from “same” and “random”. - - - * **scale_by_force** (*float*) – Default=0. If >0 then configurations near equilibrium -(with roughly force < scale_by_force) get more weight. - - - * **bfgs_conv_tol** (*float*) – Stop training if error dropped by a factor smaller than this -over 50 BFGS iterations. - - - * **weighting** (*str*) – How to weight configuration with different sizes relative to each other. -Choose from “vibrations”, “molecules” and “structures”. + * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. + energies ([float]): The list of total energies of each structure + in structures list. + * **train_energies** (*[**float**]*) – List of total energies of each structure in + structures list. + * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure + with m atoms in structures list. m can be varied with each single + structure case. + * **train_stresses** (*list*) – List of (6, ) virial stresses of each structure + in structures list. + * **unfitted_mtp** (*str*) – Define the initial mtp file. Default to the mtp file + stored in .params directory. + * **max_dist** (*float*) – The actual radial cutoff. + * **radial_basis_size** (*int*) – Relevant to number of radial basis function. + * **max_iter** (*int*) – The number of maximum iteration. + * **energy_weight** (*float*) – The weight of energy. + * **force_weight** (*float*) – The weight of forces. + * **stress_weight** (*float*) – The weight of stresses. Zero-weight can be assigned. + * **init_params** (*str*) – How to initialize parameters if a potential was not + pre-fitted. Choose from “same” and “random”. + * **scale_by_force** (*float*) – Default=0. If >0 then configurations near equilibrium + (with roughly force < scale_by_force) get more weight. + * **bfgs_conv_tol** (*float*) – Stop training if error dropped by a factor smaller than this + over 50 BFGS iterations. + * **weighting** (*str*) – How to weight configuration with different sizes relative to each other. + Choose from “vibrations”, “molecules” and “structures”. ### write_cfg(filename, cfg_pool) @@ -570,13 +449,11 @@ Supported keyword arguments are parallel with options stated in the mlip manuals mlip-2 is recommended, as it is the only officially supported version by mlip. Please refer to [https://mlip.skoltech.ru](https://mlip.skoltech.ru). - * **Parameters** - - * **mlip-2** – mtp_filename (str): Name of file with MTP to be loaded. -write_cfgs (str): Name of file for mlp processed configurations to be written to. -write_cfgs_skip (int): Skipped number of processed configurations before writing. -select (bool): activates or deactivates calculation of extrapolation grades and + * **mlip-2** – mtp_filename (str): Name of file with MTP to be loaded. + write_cfgs (str): Name of file for mlp processed configurations to be written to. + write_cfgs_skip (int): Skipped number of processed configurations before writing. + select (bool): activates or deactivates calculation of extrapolation grades and > optionally writing configurations with high extrapolation grades. False is > recommended for large-scale MD run. @@ -611,41 +488,31 @@ select_log (str): Name of file (or standard output stream stdout/stderr) for writing a log of the configuration selection process. ``` - - * **mlip-dev** – Abinitio (int): Defines Ab-initio models. Default to 1. +```none +* **mlip-dev** – Abinitio (int): Defines Ab-initio models. Default to 1. +``` > 0: If Ab-initio models is not required. > 1: Used if driver provides EFS data with configurations. > 2: Use embedded Lennard-Jones pair potentials. - > > r_min (float): Distance to minimum of pair function (in Angstroms). - > > ```none > > Default to 2.0. > > ``` - > > scale (float): Value of pair function in minimum (in eV). - > > ```none > > Default to 1.0. > > ``` - > > cutoff (float): Cutoff radius (in Angstroms). Default to 5.0. - > 3: Use DFT models by VASP. Linking via files exchange. - > > POSCAR (str): Relative path of POSCAR file. > > OUTCAR (str): Relative path of OUTCAR file. > > Start_command (str): Relative path of command file. - > 4: Use potentials calculating by LAMMPS. Linking via files exchange. - > > Input_file (str): File with configuration to be read by lammps. > > Output_file (str): File with configuration and EFS data to be read by MLIP. > > Start_command (str): Relative path of command file. - > 5: Use MTP as Ab-initio potentials. - > > MTP_filename (str): MTP file name. MLIP (str): MTP. @@ -653,139 +520,95 @@ MLIP (str): MTP. > load_from (str): Potential filename. > Cacluate_EFS (bool): Whether to perform EFS calculation by MTP. > Fit (bool): Whether to perform MTP learning. - > > Save (str): Output MTP file name (for trained MTP). > > Energy_equation_weight (float): Weight for energy equation in - > > > fitting procedure. Default to 1.0. - > > Forces_equation_weight (float): Weight for forces equations in - > > ```none > > fitting procedure. Default to 0.001. > > ``` - > > Stress_equation_weight (float): Weight for stresses equations in - > > ```none > > fitting procedure. Default to 0.1. > > ``` - > > Relative_forces_weight (float): If greater than zero, large forces - > > ```none > > will be fitted less accurate than small. Default to 0.0. > > ``` - > > Fit_log (str): File to write fitting log. No logging if not specified. - > > ```none > > Default to None. > > ``` - > Select (bool): Whether to activate active learning. Default to False. - > > Site_E_weight (float): Weight for site energy equations in - > > ```none > > selection procedure. Default to 1.0. > > ``` - > > Energy_weight (float): Weight for energy equation in - > > ```none > > selection procedure. Default to 0.0. > > ``` - > > Forces_weight (float): Weight for forces equations in - > > ```none > > selection procedure. Default to 0.0. > > ``` - > > Stress_weight (float): Weight for stresses equations in - > > ```none > > selection procedure. Default to 0.0. > > ``` - > > Threshold_slct (float): Selection threshold - maximum - > > ```none > > allowed extrapolation level. Default to 0.1. > > ``` - > > Save_TS (str): Filename where selected configurations - > > ```none > > will be saved. No configuration saving if not specified. > > Default to None. > > ``` - > > Save_state (str): Filename where state of the selection - > > ```none > > will be saved. No saving if not specified. Default to None. > > ``` - > > Load_state (str): Filename where state of the selection - > > ```none > > will be loaded. No saving if not specified. Default to None. > > ``` - > > Select_log (str): File to write fitting log. No logging - > > ```none > > if not specified. Default to None. > > ``` - > LOFT (bool): Whether to perform learning on the fly. Default to False - > > EFSviaMTP (bool): Works only on LOFT regime. If True, - > > ```none > > only MTP-calculated EFS will be passed to driver, else > > pass to driver ab-initio EFS while LOTF when learning occurs. > > ``` - > > Log (str): Filename to write log of learning on the fly process. - > > ```none > > No logging if not specified. Default to None. > > ``` - > Check_errors (bool): If True, comparison and accumulation of - > ```none > error statistics for EFS calculated by ab-initio models and MTP. > Default to False. > ``` - > ```none > Log (str): Filename to write log of learning on the fly process. > ``` - > ```none > No logging if not specified. Default to None. > ``` - > Write_cfgs (bool): File for writing all processed configurations. - > ```none > No configuration recording if not specified. Default to None. > ``` - > ```none > Skip_N (int): The number of configurations to skip while writing. > ``` - > ```none > Default to 0. > ``` - > Log (str): Filename to write MLIP log. No logging if not specified. - > ```none > Default to None. > ``` @@ -794,81 +617,56 @@ Driver (int): Defines the configuration driver. Default to 1. > 0: No driver or external MD driver. > 1: Read configurations from database file. - > > Database_filename (str): Configuration file name. > > Max_count (int): Maximal number of configurations to read. > > Log (str): Filename to write reading log. No logging - > > > if not specified. Default to None. - > 2: Embedded algorithm for relaxation. - > > Pressure (float): External pressure (in GPa). - > > ```none > > If not zero enthalpy is minimized. Default to 0.0. > > ``` - > > Iteration_limit (int): Maximal number of iteration of - > > ```none > > the relaxation process. Default to 500. > > ``` - > > Min_dist (float): Minimal interatomic distance constraint - > > ```none > > (in Angstroms). Default to 1.0. > > ``` - > > Forces_tolerance (float): Forces on atoms in relaxed - > > ```none > > configuration should be smaller than this value > > (in eV/Angstroms). Default to 0.0001. > > ``` - > > Stress_tolerance (float): Stresses in relaxed configuration - > > ```none > > should be smaller than this value (in GPa). Default to 0.001. > > ``` - > > Max_step (float): Maximal allowed displacement of atoms and - > > ```none > > lattice vectors in Cartesian coordinates (in Angstroms). > > Default to 0.5. > > ``` - > > Min_step (float): Minimal displacement of atoms and - > > ```none > > lattice vectors in Cartesian coordinates (in Angstroms). > > Default to 1.0e-8. > > ``` - > > BFGS_Wolfe_C1 (float): Wolfe condition constant on the function - > > ```none > > decrease (linesearch stopping criterea). Default to 1.0e-3. > > ``` - > > BFGS_Wolfe_C2 (float): Wolfe condition constant on the gradient - > > ```none > > decrease (linesearch stopping criterea). Default to 0.7. > > ``` - > > Save_relaxed (str): Filename for output results of relaxation. - > > ```none > > No configuration will be saved if not specified. > > Default to None. > > ``` - > > Log (str): Filename to write relaxation log. No logging - > > ```none > > if not specified. Default to None. > > ``` @@ -877,9 +675,8 @@ Driver (int): Defines the configuration driver. Default to 1. Write fitted mtp parameter file to perform lammps calculation. - * **Parameters** -**fitted_mtp** (*str*) – Filename to store xml formatted parameters. + **fitted_mtp** (*str*) – Filename to store xml formatted parameters. ## *class* maml.apps.pes.NNPotential(name=None, param=None, weight_param=None, scaling_param=None) @@ -889,27 +686,19 @@ This class implements Neural Network Potential. ### *abc_impl(* = <_abc.*abc_data object* ) -### _line_up(structure, energy, forces, virial_stress) +### \_line_up(structure, energy, forces, virial_stress) Convert input structure, energy, forces, virial_stress to proper configuration format for n2p2 usage. Note that n2p2 takes bohr as length unit and Hartree as energy unit. - * **Parameters** - - * **structure** (*Structure*) – Pymatgen Structure object. - - - * **energy** (*float*) – DFT-calculated energy of the system. - - - * **forces** (*list*) – The forces should have dimension -(num_atoms, 3). - - - * **virial_stress** (*list*) – stress should has 6 distinct -elements arranged in order [xx, yy, zz, xy, yz, xz]. + * **structure** (*Structure*) – Pymatgen Structure object. + * **energy** (*float*) – DFT-calculated energy of the system. + * **forces** (*list*) – The forces should have dimension + (num_atoms, 3). + * **virial_stress** (*list*) – stress should has 6 distinct + elements arranged in order [xx, yy, zz, xy, yz, xz]. ### bohr_to_angstrom(_ = 0.52917721090_ ) @@ -920,69 +709,49 @@ elements arranged in order [xx, yy, zz, xy, yz, xz]. Evaluate energies, forces and stresses of structures with trained interatomic potentials. - * **Parameters** - - * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. - - - * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of -each structure in structures list. - - - * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of -each structure with m atoms in structures list. m can be varied -with each single structure case. - - - * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses -of each structure in structures list. + * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. + * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of + each structure in structures list. + * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of + each structure with m atoms in structures list. m can be varied + with each single structure case. + * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses + of each structure in structures list. ### *static* from_config(input_filename, scaling_filename, weights_filenames) Initialize potentials with parameters file. - * **Parameters** - - * **input_filename** (*str*) – The file storing the input configuration of -Neural Network Potential. - - - * **scaling_filename** (*str*) – The file storing scaling info of -Neural Network Potential. - - - * **weights_filenames** (*list*) – List of files storing weights of each specie in -Neural Network Potential. + * **input_filename** (*str*) – The file storing the input configuration of + Neural Network Potential. + * **scaling_filename** (*str*) – The file storing scaling info of + Neural Network Potential. + * **weights_filenames** (*list*) – List of files storing weights of each specie in + Neural Network Potential. ### load_input(filename=’input.nn’) Load input file from trained Neural Network Potential. - * **Parameters** -**filename** (*str*) – The input filename. + **filename** (*str*) – The input filename. ### load_scaler(scaling_filename) Load scaling info of trained Neural Network Potential. - * **Parameters** -**scaling_filename** (*str*) – The scaling file. + **scaling_filename** (*str*) – The scaling file. ### load_weights(weights_filename, specie) Load weights file of trained Neural Network Potential. - * **Parameters** - - * **weights_filename** (*str*) – The weights file. - - - * **specie** (*str*) – The name of specie. + * **weights_filename** (*str*) – The weights file. + * **specie** (*str*) – The name of specie. ### pair_coeff(_ = ‘pair_coeff \* \* {}_ ) @@ -992,61 +761,42 @@ Load weights file of trained Neural Network Potential. Read the configuration file. - * **Parameters** -**filename** (*str*) – The configuration file to be read. + **filename** (*str*) – The configuration file to be read. ### train(train_structures, train_energies, train_forces, train_stresses=None, \*\*kwargs) Training data with moment tensor method. - * **Parameters** - - * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. -energies ([float]): The list of total energies of each structure -in structures list. - - - * **train_energies** (*[**float**]*) – List of total energies of each structure in -structures list. - - - * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure -with m atoms in structures list. m can be varied with each -single structure case. - - - * **train_stresses** (*list*) – List of (6, ) virial stresses of each -structure in structures list. - - - * **kwargs** – Parameters in write_input method. + * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. + energies ([float]): The list of total energies of each structure + in structures list. + * **train_energies** (*[**float**]*) – List of total energies of each structure in + structures list. + * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure + with m atoms in structures list. m can be varied with each + single structure case. + * **train_stresses** (*list*) – List of (6, ) virial stresses of each + structure in structures list. + * **kwargs** – Parameters in write_input method. ### write_cfgs(filename, cfg_pool) Write the formatted configuration file. - * **Parameters** - - * **filename** (*str*) – The filename to be written. - - - * **cfg_pool** (*list*) – The configuration pool contains -structure and energy/forces properties. + * **filename** (*str*) – The filename to be written. + * **cfg_pool** (*list*) – The configuration pool contains + structure and energy/forces properties. ### write_input(\*\*kwargs) Write input.nn file to train the Neural Network Potential. - * **Parameters** - - * **atom_energy** (*float*) – Atomic reference energy. - - - * **kwargs** – General nnp settings: + * **atom_energy** (*float*) – Atomic reference energy. + * **kwargs** – General nnp settings: atom_energy (dict): Free atom reference energy for each specie. cutoff_type (int): Type of cutoff function. Default to 1 @@ -1227,15 +977,15 @@ Bases: `LMPStaticCalculator` NudgedElasticBand migration energy calculator. -### _parse() +### \_parse() Parse results from dump files. -### _sanity_check(structure) +### \_sanity_check(structure) Check if the structure is valid for this calculation. -### _setup() +### \_setup() Setup a calculation, writing input files, etc. @@ -1247,16 +997,10 @@ Calculate the NEB barrier given Potential class. Get the unit cell from specie, lattice type and lattice constant. - * **Parameters** - - * **specie** (*str*) – Name of specie. - - - * **lattice** (*str*) – The lattice type of structure. e.g. bcc or diamond. - - - * **alat** (*float*) – The lattice constant of specific lattice and specie. + * **specie** (*str*) – Name of specie. + * **lattice** (*str*) – The lattice type of structure. e.g. bcc or diamond. + * **alat** (*float*) – The lattice constant of specific lattice and specie. ## *class* maml.apps.pes.Potential(model, describer: BaseDescriber | None = None, \*\*kwargs) @@ -1278,45 +1022,27 @@ This class implements Spectral Neighbor Analysis Potential. Evaluate energies, forces and stresses of structures with trained machinea learning potentials. - * **Parameters** - - * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. - - - * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of -each structure in structures list. - - - * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of -each structure with m atoms in structures list. m can be varied -with each single structure case. - - - * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses -of each structure in structures list. - - - * **include_stress** (*bool*) – Whether to include stress components. - - - * **stress_format** (*str*) – stress format, default to “VASP” + * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. + * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of + each structure in structures list. + * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of + each structure with m atoms in structures list. m can be varied + with each single structure case. + * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses + of each structure in structures list. + * **include_stress** (*bool*) – Whether to include stress components. + * **stress_format** (*str*) – stress format, default to “VASP” ### *static* from_config(param_file, coeff_file, \*\*kwargs) Initialize potentials with parameters file and coefficient file. - * **Parameters** - - * **param_file** (*str*) – The file storing the configuration of potentials. - - - * **coeff_file** (*str*) – The file storing the coefficients of potentials. - - + * **param_file** (*str*) – The file storing the configuration of potentials. + * **coeff_file** (*str*) – The file storing the coefficients of potentials. * **Returns** -SNAPotential. + SNAPotential. ### pair_coeff(_ = ‘pair_coeff \* \* {coeff_file} {param_file} {elements}_ ) @@ -1326,31 +1052,19 @@ SNAPotential. Training data with models. - * **Parameters** - - * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. -energies ([float]): The list of total energies of each structure -in structures list. - - - * **train_energies** (*[**float**]*) – List of total energies of each structure in -structures list. - - - * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each -structure with m atoms in structures list. m can be varied with -each single structure case. - - - * **train_stresses** (*list*) – List of (6, ) virial stresses of each -structure in structures list. - - - * **include_stress** (*bool*) – Whether to include stress components. - - - * **stress_format** (*string*) – stress format, default to VASP + * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. + energies ([float]): The list of total energies of each structure + in structures list. + * **train_energies** (*[**float**]*) – List of total energies of each structure in + structures list. + * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each + structure with m atoms in structures list. m can be varied with + each single structure case. + * **train_stresses** (*list*) – List of (6, ) virial stresses of each + structure in structures list. + * **include_stress** (*bool*) – Whether to include stress components. + * **stress_format** (*string*) – stress format, default to VASP ### write_param() @@ -1385,15 +1099,15 @@ e: 2d NumPy array with shape (N, 1) containing the element of ### *CMDS(* = [‘pair_style lj/cut 10’, ‘pair_coeff \* \* 1 1’, ‘compute sna all sna/atom ‘, ‘compute snad all snad/atom ‘, ‘compute snav all snav/atom ‘, ‘dump 1 all custom 1 dump.element element’, ‘dump_modify 1 sort id’, ‘dump 2 all custom 1 dump.sna c_sna[\*]’, ‘dump_modify 2 sort id’, ‘dump 3 all custom 1 dump.snad c_snad[\*]’, ‘dump_modify 3 sort id’, ‘dump 4 all custom 1 dump.snav c_snav[\*]’, ‘dump_modify 4 sort id’_ ) -### _parse() +### \_parse() Parse results from dump files. -### _sanity_check(structure) +### \_sanity_check(structure) Check if the structure is valid for this calculation. -### _setup() +### \_setup() Setup a calculation, writing input files, etc. @@ -1402,13 +1116,10 @@ Setup a calculation, writing input files, etc. Method to list the subscripts 2j1, 2j2, 2j of bispectrum components. - * **Parameters** -**twojmax** (*int*) – Band limit for bispectrum components. - - + **twojmax** (*int*) – Band limit for bispectrum components. * **Returns** -List of all subscripts [2j1, 2j2, 2j]. + List of all subscripts [2j1, 2j2, 2j]. ### *property* n_bs() @@ -1441,23 +1152,15 @@ Abstract base class for a Interatomic Potential. Evaluate energies, forces and stresses of structures with trained interatomic potentials. - * **Parameters** - - * **test_structures** (*list*) – List of Pymatgen Structure Objects. - - - * **test_energies** (*list*) – List of DFT-calculated total energies of each -structure in structures list. - - - * **test_forces** (*list*) – List of DFT-calculated (m, 3) forces of each -structure with m atoms in structures list. m can be varied with -each single structure case. - - - * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses of -each structure in structures list. + * **test_structures** (*list*) – List of Pymatgen Structure Objects. + * **test_energies** (*list*) – List of DFT-calculated total energies of each + structure in structures list. + * **test_forces** (*list*) – List of DFT-calculated (m, 3) forces of each + structure with m atoms in structures list. m can be varied with + each single structure case. + * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses of + each structure in structures list. #### *abstract* from_config(\*\*kwargs) @@ -1467,13 +1170,10 @@ Initialize potentials with parameters file. Predict energy, forces and stresses of the structure. - * **Parameters** -**structure** (*Structure*) – Pymatgen Structure object. - - + **structure** (*Structure*) – Pymatgen Structure object. * **Returns** -energy, forces, stress + energy, forces, stress #### *abstract* train(train_structures, train_energies, train_forces, train_stresses, \*\*kwargs) @@ -1483,23 +1183,15 @@ Train interatomic potentials with energies, forces ann stresses corresponding to structures. ``` - * **Parameters** - - * **train_structures** (*list*) – List of Pymatgen Structure objects. - - - * **train_energies** (*list*) – List of DFT-calculated total energies of each -structure in structures list. - - - * **train_forces** (*list*) – List of DFT-calculated (m, 3) forces of each -structure with m atoms in structures list. m can be varied with -each single structure case. - - - * **train_stresses** (*list*) – List of DFT-calculated (6, ) virial stresses of -each structure in structures list. + * **train_structures** (*list*) – List of Pymatgen Structure objects. + * **train_energies** (*list*) – List of DFT-calculated total energies of each + structure in structures list. + * **train_forces** (*list*) – List of DFT-calculated (m, 3) forces of each + structure with m atoms in structures list. m can be varied with + each single structure case. + * **train_stresses** (*list*) – List of DFT-calculated (6, ) virial stresses of + each structure in structures list. #### *abstract* write_param() @@ -1518,26 +1210,18 @@ This class implements Smooth Overlap of Atomic Position potentials. #### *abc_impl(* = <_abc.*abc_data object* ) -#### *static* _line_up(structure, energy, forces, virial_stress) +#### *static* \_line_up(structure, energy, forces, virial_stress) Convert input structure, energy, forces, virial_stress to proper configuration format for MLIP usage. - * **Parameters** - - * **structure** (*Structure*) – Pymatgen Structure object. - - - * **energy** (*float*) – DFT-calculated energy of the system. - - - * **forces** (*list*) – The forces should have dimension -(num_atoms, 3). - - - * **virial_stress** (*list*) – stress should has 6 distinct -elements arranged in order [xx, yy, zz, xy, yz, xz]. + * **structure** (*Structure*) – Pymatgen Structure object. + * **energy** (*float*) – DFT-calculated energy of the system. + * **forces** (*list*) – The forces should have dimension + (num_atoms, 3). + * **virial_stress** (*list*) – stress should has 6 distinct + elements arranged in order [xx, yy, zz, xy, yz, xz]. Returns: @@ -1546,46 +1230,29 @@ Returns: Evaluate energies, forces and stresses of structures with trained interatomic potentials. - * **Parameters** - - * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. - - - * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of -each structure in structures list. - - - * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of -each structure with m atoms in structures list. m can be varied -with each single structure case. - - - * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses -of each structure in structures list. - - - * **predict_energies** (*bool*) – Whether to predict energies of configurations. - - - * **predict_forces** (*bool*) – Whether to predict forces of configurations. - - - * **predict_stress** (*bool*) – Whether to predict virial stress of -configurations. + * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. + * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of + each structure in structures list. + * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of + each structure with m atoms in structures list. m can be varied + with each single structure case. + * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses + of each structure in structures list. + * **predict_energies** (*bool*) – Whether to predict energies of configurations. + * **predict_forces** (*bool*) – Whether to predict forces of configurations. + * **predict_stress** (*bool*) – Whether to predict virial stress of + configurations. #### *static* from_config(filename) Initialize potentials with parameters file. - * **Parameters** -**filename** (*str*) – The file storing parameters of potentials, -filename should ends with “.xml”. - - + **filename** (*str*) – The file storing parameters of potentials, + filename should ends with “.xml”. * **Returns** -GAPotential. + GAPotential. #### pair_coeff(_ = ‘pair_coeff \* \* {} {} {}_ ) @@ -1595,64 +1262,42 @@ GAPotential. Read the configuration file. - * **Parameters** -**filename** (*str*) – The configuration file to be read. + **filename** (*str*) – The configuration file to be read. #### save(filename=’param.yaml’) Save parameters of the potentials. - * **Parameters** -**filename** (*str*) – The file to store parameters of potentials. - - + **filename** (*str*) – The file to store parameters of potentials. * **Returns** -(str) + (str) #### train(train_structures, train_energies, train_forces, train_stresses=None, default_sigma=(0.0005, 0.1, 0.05, 0.01), use_energies=True, use_forces=True, use_stress=False, \*\*kwargs) Training data with gaussian process regression. - * **Parameters** - - * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. -energies ([float]): The list of total energies of each structure -in structures list. - - - * **train_energies** (*[**float**]*) – List of total energies of each structure in -structures list. - - - * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure -with m atoms in structures list. m can be varied with each -single structure case. - - - * **train_stresses** (*list*) – List of (6, ) virial stresses of each -structure in structures list. - - - * **default_sigma** (*list*) – Error criteria in energies, forces, stress -and hessian. Should have 4 numbers. - - - * **use_energies** (*bool*) – Whether to use dft total energies for training. -Default to True. - - - * **use_forces** (*bool*) – Whether to use dft atomic forces for training. -Default to True. - - - * **use_stress** (*bool*) – Whether to use dft virial stress for training. -Default to False. - - - * **kwargs** – l_max (int): Parameter to configure GAP. The band limit of + * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. + energies ([float]): The list of total energies of each structure + in structures list. + * **train_energies** (*[**float**]*) – List of total energies of each structure in + structures list. + * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure + with m atoms in structures list. m can be varied with each + single structure case. + * **train_stresses** (*list*) – List of (6, ) virial stresses of each + structure in structures list. + * **default_sigma** (*list*) – Error criteria in energies, forces, stress + and hessian. Should have 4 numbers. + * **use_energies** (*bool*) – Whether to use dft total energies for training. + Default to True. + * **use_forces** (*bool*) – Whether to use dft atomic forces for training. + Default to True. + * **use_stress** (*bool*) – Whether to use dft virial stress for training. + Default to False. + * **kwargs** – l_max (int): Parameter to configure GAP. The band limit of spherical harmonics basis function. Default to 12. @@ -1740,22 +1385,17 @@ e0_offset (float): Offset of baseline. If zero, the offset is Write the formatted configuration file. - * **Parameters** - - * **filename** (*str*) – The filename to be written. - - - * **cfg_pool** (*list*) – The configuration pool contains -structure and energy/forces properties. + * **filename** (*str*) – The filename to be written. + * **cfg_pool** (*list*) – The configuration pool contains + structure and energy/forces properties. #### write_param(xml_filename=’gap.2020.01.xml’) Write xml file to perform lammps calculation. - * **Parameters** -**xml_filename** (*str*) – Filename to store xml formatted parameters. + **xml_filename** (*str*) – Filename to store xml formatted parameters. ## maml.apps.pes._lammps module @@ -1767,15 +1407,15 @@ Bases: `LMPStaticCalculator` Defect formation energy calculator. -#### _parse() +#### \_parse() Parse results from dump files. -#### _sanity_check(structure) +#### \_sanity_check(structure) Check if the structure is valid for this calculation. -#### _setup() +#### \_setup() Setup a calculation, writing input files, etc. @@ -1787,16 +1427,10 @@ Calculate the vacancy formation given Potential class. Get the unit cell from specie, lattice type and lattice constant. - * **Parameters** - - * **specie** (*str*) – Name of specie. - - - * **lattice** (*str*) – The lattice type of structure. e.g. bcc or diamond. - - - * **alat** (*float*) – The lattice constant of specific lattice and specie. + * **specie** (*str*) – Name of specie. + * **lattice** (*str*) – The lattice type of structure. e.g. bcc or diamond. + * **alat** (*float*) – The lattice constant of specific lattice and specie. ### *class* maml.apps.pes._lammps.ElasticConstant(ff_settings, potential_type=’external’, deformation_size=1e-06, jiggle=1e-05, maxiter=400, maxeval=1000, full_matrix=False, \*\*kwargs) @@ -1806,15 +1440,15 @@ Elastic constant calculator. #### *RESTART_CONFIG(* = {‘external’: {‘read_command’: ‘read_restart’, ‘restart_file’: ‘restart.equil’, ‘write_command’: ‘write_restart’}, ‘internal’: {‘read_command’: ‘read_restart’, ‘restart_file’: ‘restart.equil’, ‘write_command’: ‘write_restart’}_ ) -#### _parse() +#### \_parse() Parse results from dump files. -#### _sanity_check(structure) +#### \_sanity_check(structure) Check if the structure is valid for this calculation. -#### _setup() +#### \_setup() Setup a calculation, writing input files, etc. @@ -1824,17 +1458,17 @@ Bases: `LMPStaticCalculator` Calculate energy, forces and virial stress of structures. -#### _parse() +#### \_parse() Parse results from dump files. -#### *static* _rotate_force_stress(structure, forces, stresses) +#### *static* \_rotate_force_stress(structure, forces, stresses) -#### _sanity_check(structure) +#### \_sanity_check(structure) Check if the structure is valid for this calculation. -#### _setup() +#### \_setup() Setup a calculation, writing input files, etc. @@ -1844,9 +1478,8 @@ Calculate the energy, forces and stresses of structures. Proper rotation of the results are applied when the structure is triclinic. - * **Parameters** -**structures** (*list*) – a list of structures + **structures** (*list*) – a list of structures Returns: list of (energy, forces, stresses) tuple @@ -1856,15 +1489,15 @@ Bases: `LMPStaticCalculator` Structural Relaxation Calculator. -#### _parse() +#### \_parse() Parse results from dump files. -#### _sanity_check(structure) +#### \_sanity_check(structure) Check if the structure is valid for this calculation. -#### _setup() +#### \_setup() Setup a calculation, writing input files, etc. @@ -1877,15 +1510,15 @@ using LAMMPS. #### *COMMON_CMDS(* = [‘units metal’, ‘atom_style charge’, ‘box tilt large’, ‘read_data data.static’, ‘run 0’_ ) -#### *abstract* _parse() +#### *abstract* \_parse() Parse results from dump files. -#### *abstract* _sanity_check(structure) +#### *abstract* \_sanity_check(structure) Check if the structure is valid for this calculation. -#### *abstract* _setup() +#### *abstract* \_setup() Setup a calculation, writing input files, etc. @@ -1895,22 +1528,18 @@ Setup a calculation, writing input files, etc. Perform the calculation on a series of structures. - * **Parameters** -**structures** – Input structures in a list. - - + **structures** – Input structures in a list. * **Returns** -List of computed data corresponding to each structure, -varies with different subclasses. + List of computed data corresponding to each structure, + varies with different subclasses. #### set_lmp_exe(lmp_exe: str) Set lammps executable for the instance. - * **Parameters** -**lmp_exe** (*str*) – lammps executable path + **lmp_exe** (*str*) – lammps executable path Returns: @@ -1927,13 +1556,10 @@ energy/force/stress calculations. Predict energy, forces and stresses of the structure. - * **Parameters** -**structure** (*Structure*) – Pymatgen Structure object. - - + **structure** (*Structure*) – Pymatgen Structure object. * **Returns** -energy, forces, stress + energy, forces, stress ### *class* maml.apps.pes._lammps.LatticeConstant(ff_settings, box_relax=True, box_relax_keywords=’aniso 0.0 vmax 0.001’, box_triclinic=False, min_style=’cg’, etol=1e-15, ftol=1e-15, maxiter=5000, maxeval=5000, \*\*kwargs) @@ -1945,13 +1571,10 @@ Lattice Constant Relaxation Calculator. Calculate the relaxed lattice parameters of a list of structures. - * **Parameters** -**structures** (*[**Structure**]*) – Input structures in a list. - - + **structures** (*[**Structure**]*) – Input structures in a list. * **Returns** -List of relaxed lattice constants (a, b, c in Å) of the input structures. + List of relaxed lattice constants (a, b, c in Å) of the input structures. ### *class* maml.apps.pes._lammps.NudgedElasticBand(ff_settings, specie, lattice, alat, num_replicas=7, \*\*kwargs) @@ -1959,15 +1582,15 @@ Bases: `LMPStaticCalculator` NudgedElasticBand migration energy calculator. -#### _parse() +#### \_parse() Parse results from dump files. -#### _sanity_check(structure) +#### \_sanity_check(structure) Check if the structure is valid for this calculation. -#### _setup() +#### \_setup() Setup a calculation, writing input files, etc. @@ -1979,16 +1602,10 @@ Calculate the NEB barrier given Potential class. Get the unit cell from specie, lattice type and lattice constant. - * **Parameters** - - * **specie** (*str*) – Name of specie. - - - * **lattice** (*str*) – The lattice type of structure. e.g. bcc or diamond. - - - * **alat** (*float*) – The lattice constant of specific lattice and specie. + * **specie** (*str*) – Name of specie. + * **lattice** (*str*) – The lattice type of structure. e.g. bcc or diamond. + * **alat** (*float*) – The lattice constant of specific lattice and specie. ### *class* maml.apps.pes._lammps.SpectralNeighborAnalysis(rcutfac, twojmax, element_profile, quadratic=False, \*\*kwargs) @@ -2019,15 +1636,15 @@ e: 2d NumPy array with shape (N, 1) containing the element of #### *CMDS(* = [‘pair_style lj/cut 10’, ‘pair_coeff \* \* 1 1’, ‘compute sna all sna/atom ‘, ‘compute snad all snad/atom ‘, ‘compute snav all snav/atom ‘, ‘dump 1 all custom 1 dump.element element’, ‘dump_modify 1 sort id’, ‘dump 2 all custom 1 dump.sna c_sna[\*]’, ‘dump_modify 2 sort id’, ‘dump 3 all custom 1 dump.snad c_snad[\*]’, ‘dump_modify 3 sort id’, ‘dump 4 all custom 1 dump.snav c_snav[\*]’, ‘dump_modify 4 sort id’_ ) -#### _parse() +#### \_parse() Parse results from dump files. -#### _sanity_check(structure) +#### \_sanity_check(structure) Check if the structure is valid for this calculation. -#### _setup() +#### \_setup() Setup a calculation, writing input files, etc. @@ -2036,13 +1653,10 @@ Setup a calculation, writing input files, etc. Method to list the subscripts 2j1, 2j2, 2j of bispectrum components. - * **Parameters** -**twojmax** (*int*) – Band limit for bispectrum components. - - + **twojmax** (*int*) – Band limit for bispectrum components. * **Returns** -List of all subscripts [2j1, 2j2, 2j]. + List of all subscripts [2j1, 2j2, 2j]. #### *property* n_bs() @@ -2063,9 +1677,8 @@ bulk_structure and miller_indexes with the SlabGenerator in pymatgen: Calculate surface energies with the formula: E(Surface) = (E(Slab) - E(bulk)) / Area(surface). (J/m^2). - * **Returns** -List of miller_indexes with their respective relaxed slab structures and surface energies in J/m^2. + List of miller_indexes with their respective relaxed slab structures and surface energies in J/m^2. ### maml.apps.pes._lammps._pretty_input(lines) @@ -2090,68 +1703,44 @@ Please refer to [https://mlip.skoltech.ru](https://mlip.skoltech.ru). #### *abc_impl(* = <_abc.*abc_data object* ) -#### _line_up(structure, energy, forces, virial_stress) +#### \_line_up(structure, energy, forces, virial_stress) Convert input structure, energy, forces, virial_stress to proper configuration format for mlip usage. - * **Parameters** - - * **structure** (*Structure*) – Pymatgen Structure object. - - - * **energy** (*float*) – DFT-calculated energy of the system. - - - * **forces** (*list*) – The forces should have dimension (num_atoms, 3). - - - * **virial_stress** (*list*) – stress should has 6 distinct -elements arranged in order [xx, yy, zz, yz, xz, xy]. + * **structure** (*Structure*) – Pymatgen Structure object. + * **energy** (*float*) – DFT-calculated energy of the system. + * **forces** (*list*) – The forces should have dimension (num_atoms, 3). + * **virial_stress** (*list*) – stress should has 6 distinct + elements arranged in order [xx, yy, zz, yz, xz, xy]. #### evaluate(test_structures, test_energies, test_forces, test_stresses=None, \*\*kwargs) Evaluate energies, forces and stresses of structures with trained interatomic potentials. - * **Parameters** - - * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. - - - * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of -each structure in structures list. - - - * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of -each structure with m atoms in structures list. m can be varied -with each single structure case. - - - * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses -of each structure in structures list. - - - * **kwargs** – Parameters of write_param method. + * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. + * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of + each structure in structures list. + * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of + each structure with m atoms in structures list. m can be varied + with each single structure case. + * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses + of each structure in structures list. + * **kwargs** – Parameters of write_param method. #### *static* from_config(filename, elements) Initialize potentials with parameters file. - * **Parameters** - - * **filename** (*str*) – The file storing parameters of potentials, filename should -ends with “.mtp”. - - - * **elements** (*list*) – The list of elements. - - + * **filename** (*str*) – The file storing parameters of potentials, filename should + ends with “.mtp”. + * **elements** (*list*) – The list of elements. * **Returns** -MTPotential + MTPotential #### pair_coeff(_ = ‘pair_coeff \* \*_ ) @@ -2159,71 +1748,40 @@ MTPotential #### read_cfgs(filename) - * **Parameters** -**filename** (*str*) – The configuration file to be read. + **filename** (*str*) – The configuration file to be read. #### train(train_structures, train_energies, train_forces, train_stresses, unfitted_mtp=’08g.mtp’, max_dist=5, radial_basis_size=8, max_iter=1000, energy_weight=1, force_weight=0.01, stress_weight=0.001, init_params=’same’, scale_by_force=0, bfgs_conv_tol=0.001, weighting=’vibration’) Training data with moment tensor method. - * **Parameters** - - * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. -energies ([float]): The list of total energies of each structure -in structures list. - - - * **train_energies** (*[**float**]*) – List of total energies of each structure in -structures list. - - - * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure -with m atoms in structures list. m can be varied with each single -structure case. - - - * **train_stresses** (*list*) – List of (6, ) virial stresses of each structure -in structures list. - - - * **unfitted_mtp** (*str*) – Define the initial mtp file. Default to the mtp file -stored in .params directory. - - - * **max_dist** (*float*) – The actual radial cutoff. - - - * **radial_basis_size** (*int*) – Relevant to number of radial basis function. - - - * **max_iter** (*int*) – The number of maximum iteration. - - - * **energy_weight** (*float*) – The weight of energy. - - - * **force_weight** (*float*) – The weight of forces. - - - * **stress_weight** (*float*) – The weight of stresses. Zero-weight can be assigned. - - - * **init_params** (*str*) – How to initialize parameters if a potential was not -pre-fitted. Choose from “same” and “random”. - - - * **scale_by_force** (*float*) – Default=0. If >0 then configurations near equilibrium -(with roughly force < scale_by_force) get more weight. - - - * **bfgs_conv_tol** (*float*) – Stop training if error dropped by a factor smaller than this -over 50 BFGS iterations. - - - * **weighting** (*str*) – How to weight configuration with different sizes relative to each other. -Choose from “vibrations”, “molecules” and “structures”. + * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. + energies ([float]): The list of total energies of each structure + in structures list. + * **train_energies** (*[**float**]*) – List of total energies of each structure in + structures list. + * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure + with m atoms in structures list. m can be varied with each single + structure case. + * **train_stresses** (*list*) – List of (6, ) virial stresses of each structure + in structures list. + * **unfitted_mtp** (*str*) – Define the initial mtp file. Default to the mtp file + stored in .params directory. + * **max_dist** (*float*) – The actual radial cutoff. + * **radial_basis_size** (*int*) – Relevant to number of radial basis function. + * **max_iter** (*int*) – The number of maximum iteration. + * **energy_weight** (*float*) – The weight of energy. + * **force_weight** (*float*) – The weight of forces. + * **stress_weight** (*float*) – The weight of stresses. Zero-weight can be assigned. + * **init_params** (*str*) – How to initialize parameters if a potential was not + pre-fitted. Choose from “same” and “random”. + * **scale_by_force** (*float*) – Default=0. If >0 then configurations near equilibrium + (with roughly force < scale_by_force) get more weight. + * **bfgs_conv_tol** (*float*) – Stop training if error dropped by a factor smaller than this + over 50 BFGS iterations. + * **weighting** (*str*) – How to weight configuration with different sizes relative to each other. + Choose from “vibrations”, “molecules” and “structures”. #### write_cfg(filename, cfg_pool) @@ -2242,13 +1800,11 @@ Supported keyword arguments are parallel with options stated in the mlip manuals mlip-2 is recommended, as it is the only officially supported version by mlip. Please refer to [https://mlip.skoltech.ru](https://mlip.skoltech.ru). - * **Parameters** - - * **mlip-2** – mtp_filename (str): Name of file with MTP to be loaded. -write_cfgs (str): Name of file for mlp processed configurations to be written to. -write_cfgs_skip (int): Skipped number of processed configurations before writing. -select (bool): activates or deactivates calculation of extrapolation grades and + * **mlip-2** – mtp_filename (str): Name of file with MTP to be loaded. + write_cfgs (str): Name of file for mlp processed configurations to be written to. + write_cfgs_skip (int): Skipped number of processed configurations before writing. + select (bool): activates or deactivates calculation of extrapolation grades and > optionally writing configurations with high extrapolation grades. False is > recommended for large-scale MD run. @@ -2283,41 +1839,31 @@ select_log (str): Name of file (or standard output stream stdout/stderr) for writing a log of the configuration selection process. ``` - - * **mlip-dev** – Abinitio (int): Defines Ab-initio models. Default to 1. +```none +* **mlip-dev** – Abinitio (int): Defines Ab-initio models. Default to 1. +``` > 0: If Ab-initio models is not required. > 1: Used if driver provides EFS data with configurations. > 2: Use embedded Lennard-Jones pair potentials. - > > r_min (float): Distance to minimum of pair function (in Angstroms). - > > ```none > > Default to 2.0. > > ``` - > > scale (float): Value of pair function in minimum (in eV). - > > ```none > > Default to 1.0. > > ``` - > > cutoff (float): Cutoff radius (in Angstroms). Default to 5.0. - > 3: Use DFT models by VASP. Linking via files exchange. - > > POSCAR (str): Relative path of POSCAR file. > > OUTCAR (str): Relative path of OUTCAR file. > > Start_command (str): Relative path of command file. - > 4: Use potentials calculating by LAMMPS. Linking via files exchange. - > > Input_file (str): File with configuration to be read by lammps. > > Output_file (str): File with configuration and EFS data to be read by MLIP. > > Start_command (str): Relative path of command file. - > 5: Use MTP as Ab-initio potentials. - > > MTP_filename (str): MTP file name. MLIP (str): MTP. @@ -2325,139 +1871,95 @@ MLIP (str): MTP. > load_from (str): Potential filename. > Cacluate_EFS (bool): Whether to perform EFS calculation by MTP. > Fit (bool): Whether to perform MTP learning. - > > Save (str): Output MTP file name (for trained MTP). > > Energy_equation_weight (float): Weight for energy equation in - > > > fitting procedure. Default to 1.0. - > > Forces_equation_weight (float): Weight for forces equations in - > > ```none > > fitting procedure. Default to 0.001. > > ``` - > > Stress_equation_weight (float): Weight for stresses equations in - > > ```none > > fitting procedure. Default to 0.1. > > ``` - > > Relative_forces_weight (float): If greater than zero, large forces - > > ```none > > will be fitted less accurate than small. Default to 0.0. > > ``` - > > Fit_log (str): File to write fitting log. No logging if not specified. - > > ```none > > Default to None. > > ``` - > Select (bool): Whether to activate active learning. Default to False. - > > Site_E_weight (float): Weight for site energy equations in - > > ```none > > selection procedure. Default to 1.0. > > ``` - > > Energy_weight (float): Weight for energy equation in - > > ```none > > selection procedure. Default to 0.0. > > ``` - > > Forces_weight (float): Weight for forces equations in - > > ```none > > selection procedure. Default to 0.0. > > ``` - > > Stress_weight (float): Weight for stresses equations in - > > ```none > > selection procedure. Default to 0.0. > > ``` - > > Threshold_slct (float): Selection threshold - maximum - > > ```none > > allowed extrapolation level. Default to 0.1. > > ``` - > > Save_TS (str): Filename where selected configurations - > > ```none > > will be saved. No configuration saving if not specified. > > Default to None. > > ``` - > > Save_state (str): Filename where state of the selection - > > ```none > > will be saved. No saving if not specified. Default to None. > > ``` - > > Load_state (str): Filename where state of the selection - > > ```none > > will be loaded. No saving if not specified. Default to None. > > ``` - > > Select_log (str): File to write fitting log. No logging - > > ```none > > if not specified. Default to None. > > ``` - > LOFT (bool): Whether to perform learning on the fly. Default to False - > > EFSviaMTP (bool): Works only on LOFT regime. If True, - > > ```none > > only MTP-calculated EFS will be passed to driver, else > > pass to driver ab-initio EFS while LOTF when learning occurs. > > ``` - > > Log (str): Filename to write log of learning on the fly process. - > > ```none > > No logging if not specified. Default to None. > > ``` - > Check_errors (bool): If True, comparison and accumulation of - > ```none > error statistics for EFS calculated by ab-initio models and MTP. > Default to False. > ``` - > ```none > Log (str): Filename to write log of learning on the fly process. > ``` - > ```none > No logging if not specified. Default to None. > ``` - > Write_cfgs (bool): File for writing all processed configurations. - > ```none > No configuration recording if not specified. Default to None. > ``` - > ```none > Skip_N (int): The number of configurations to skip while writing. > ``` - > ```none > Default to 0. > ``` - > Log (str): Filename to write MLIP log. No logging if not specified. - > ```none > Default to None. > ``` @@ -2466,81 +1968,56 @@ Driver (int): Defines the configuration driver. Default to 1. > 0: No driver or external MD driver. > 1: Read configurations from database file. - > > Database_filename (str): Configuration file name. > > Max_count (int): Maximal number of configurations to read. > > Log (str): Filename to write reading log. No logging - > > > if not specified. Default to None. - > 2: Embedded algorithm for relaxation. - > > Pressure (float): External pressure (in GPa). - > > ```none > > If not zero enthalpy is minimized. Default to 0.0. > > ``` - > > Iteration_limit (int): Maximal number of iteration of - > > ```none > > the relaxation process. Default to 500. > > ``` - > > Min_dist (float): Minimal interatomic distance constraint - > > ```none > > (in Angstroms). Default to 1.0. > > ``` - > > Forces_tolerance (float): Forces on atoms in relaxed - > > ```none > > configuration should be smaller than this value > > (in eV/Angstroms). Default to 0.0001. > > ``` - > > Stress_tolerance (float): Stresses in relaxed configuration - > > ```none > > should be smaller than this value (in GPa). Default to 0.001. > > ``` - > > Max_step (float): Maximal allowed displacement of atoms and - > > ```none > > lattice vectors in Cartesian coordinates (in Angstroms). > > Default to 0.5. > > ``` - > > Min_step (float): Minimal displacement of atoms and - > > ```none > > lattice vectors in Cartesian coordinates (in Angstroms). > > Default to 1.0e-8. > > ``` - > > BFGS_Wolfe_C1 (float): Wolfe condition constant on the function - > > ```none > > decrease (linesearch stopping criterea). Default to 1.0e-3. > > ``` - > > BFGS_Wolfe_C2 (float): Wolfe condition constant on the gradient - > > ```none > > decrease (linesearch stopping criterea). Default to 0.7. > > ``` - > > Save_relaxed (str): Filename for output results of relaxation. - > > ```none > > No configuration will be saved if not specified. > > Default to None. > > ``` - > > Log (str): Filename to write relaxation log. No logging - > > ```none > > if not specified. Default to None. > > ``` @@ -2549,29 +2026,18 @@ Driver (int): Defines the configuration driver. Default to 1. Write fitted mtp parameter file to perform lammps calculation. - * **Parameters** -**fitted_mtp** (*str*) – Filename to store xml formatted parameters. + **fitted_mtp** (*str*) – Filename to store xml formatted parameters. ### maml.apps.pes._mtp.feed(attribute, kwargs, dictionary, tab=’\\t’) - * **Parameters** - - * **attribute** (*str*) – Attribute to be operated. - - - * **kwargs** (*dict*) – Generic parameters. - - - * **dictionary** (*dict*) – The default parameters dictionary. - - - * **tab** (*str*) – ‘t’ or ‘tt’, depend on orders of attribute. - - + * **attribute** (*str*) – Attribute to be operated. + * **kwargs** (*dict*) – Generic parameters. + * **dictionary** (*dict*) – The default parameters dictionary. + * **tab** (*str*) – ‘t’ or ‘tt’, depend on orders of attribute. * **Returns** -(str). + (str). ## maml.apps.pes._nnp module @@ -2585,27 +2051,19 @@ This class implements Neural Network Potential. #### *abc_impl(* = <_abc.*abc_data object* ) -#### _line_up(structure, energy, forces, virial_stress) +#### \_line_up(structure, energy, forces, virial_stress) Convert input structure, energy, forces, virial_stress to proper configuration format for n2p2 usage. Note that n2p2 takes bohr as length unit and Hartree as energy unit. - * **Parameters** - - * **structure** (*Structure*) – Pymatgen Structure object. - - - * **energy** (*float*) – DFT-calculated energy of the system. - - - * **forces** (*list*) – The forces should have dimension -(num_atoms, 3). - - - * **virial_stress** (*list*) – stress should has 6 distinct -elements arranged in order [xx, yy, zz, xy, yz, xz]. + * **structure** (*Structure*) – Pymatgen Structure object. + * **energy** (*float*) – DFT-calculated energy of the system. + * **forces** (*list*) – The forces should have dimension + (num_atoms, 3). + * **virial_stress** (*list*) – stress should has 6 distinct + elements arranged in order [xx, yy, zz, xy, yz, xz]. #### bohr_to_angstrom(_ = 0.52917721090_ ) @@ -2616,69 +2074,49 @@ elements arranged in order [xx, yy, zz, xy, yz, xz]. Evaluate energies, forces and stresses of structures with trained interatomic potentials. - * **Parameters** - - * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. - - - * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of -each structure in structures list. - - - * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of -each structure with m atoms in structures list. m can be varied -with each single structure case. - - - * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses -of each structure in structures list. + * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. + * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of + each structure in structures list. + * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of + each structure with m atoms in structures list. m can be varied + with each single structure case. + * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses + of each structure in structures list. #### *static* from_config(input_filename, scaling_filename, weights_filenames) Initialize potentials with parameters file. - * **Parameters** - - * **input_filename** (*str*) – The file storing the input configuration of -Neural Network Potential. - - - * **scaling_filename** (*str*) – The file storing scaling info of -Neural Network Potential. - - - * **weights_filenames** (*list*) – List of files storing weights of each specie in -Neural Network Potential. + * **input_filename** (*str*) – The file storing the input configuration of + Neural Network Potential. + * **scaling_filename** (*str*) – The file storing scaling info of + Neural Network Potential. + * **weights_filenames** (*list*) – List of files storing weights of each specie in + Neural Network Potential. #### load_input(filename=’input.nn’) Load input file from trained Neural Network Potential. - * **Parameters** -**filename** (*str*) – The input filename. + **filename** (*str*) – The input filename. #### load_scaler(scaling_filename) Load scaling info of trained Neural Network Potential. - * **Parameters** -**scaling_filename** (*str*) – The scaling file. + **scaling_filename** (*str*) – The scaling file. #### load_weights(weights_filename, specie) Load weights file of trained Neural Network Potential. - * **Parameters** - - * **weights_filename** (*str*) – The weights file. - - - * **specie** (*str*) – The name of specie. + * **weights_filename** (*str*) – The weights file. + * **specie** (*str*) – The name of specie. #### pair_coeff(_ = ‘pair_coeff \* \* {}_ ) @@ -2688,61 +2126,42 @@ Load weights file of trained Neural Network Potential. Read the configuration file. - * **Parameters** -**filename** (*str*) – The configuration file to be read. + **filename** (*str*) – The configuration file to be read. #### train(train_structures, train_energies, train_forces, train_stresses=None, \*\*kwargs) Training data with moment tensor method. - * **Parameters** - - * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. -energies ([float]): The list of total energies of each structure -in structures list. - - - * **train_energies** (*[**float**]*) – List of total energies of each structure in -structures list. - - - * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure -with m atoms in structures list. m can be varied with each -single structure case. - - - * **train_stresses** (*list*) – List of (6, ) virial stresses of each -structure in structures list. - - - * **kwargs** – Parameters in write_input method. + * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. + energies ([float]): The list of total energies of each structure + in structures list. + * **train_energies** (*[**float**]*) – List of total energies of each structure in + structures list. + * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure + with m atoms in structures list. m can be varied with each + single structure case. + * **train_stresses** (*list*) – List of (6, ) virial stresses of each + structure in structures list. + * **kwargs** – Parameters in write_input method. #### write_cfgs(filename, cfg_pool) Write the formatted configuration file. - * **Parameters** - - * **filename** (*str*) – The filename to be written. - - - * **cfg_pool** (*list*) – The configuration pool contains -structure and energy/forces properties. + * **filename** (*str*) – The filename to be written. + * **cfg_pool** (*list*) – The configuration pool contains + structure and energy/forces properties. #### write_input(\*\*kwargs) Write input.nn file to train the Neural Network Potential. - * **Parameters** - - * **atom_energy** (*float*) – Atomic reference energy. - - - * **kwargs** – General nnp settings: + * **atom_energy** (*float*) – Atomic reference energy. + * **kwargs** – General nnp settings: atom_energy (dict): Free atom reference energy for each specie. cutoff_type (int): Type of cutoff function. Default to 1 @@ -2934,45 +2353,27 @@ This class implements Spectral Neighbor Analysis Potential. Evaluate energies, forces and stresses of structures with trained machinea learning potentials. - * **Parameters** - - * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. - - - * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of -each structure in structures list. - - - * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of -each structure with m atoms in structures list. m can be varied -with each single structure case. - - - * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses -of each structure in structures list. - - - * **include_stress** (*bool*) – Whether to include stress components. - - - * **stress_format** (*str*) – stress format, default to “VASP” + * **test_structures** (*[**Structure**]*) – List of Pymatgen Structure Objects. + * **test_energies** (*[**float**]*) – List of DFT-calculated total energies of + each structure in structures list. + * **test_forces** (*[**np.array**]*) – List of DFT-calculated (m, 3) forces of + each structure with m atoms in structures list. m can be varied + with each single structure case. + * **test_stresses** (*list*) – List of DFT-calculated (6, ) viriral stresses + of each structure in structures list. + * **include_stress** (*bool*) – Whether to include stress components. + * **stress_format** (*str*) – stress format, default to “VASP” #### *static* from_config(param_file, coeff_file, \*\*kwargs) Initialize potentials with parameters file and coefficient file. - * **Parameters** - - * **param_file** (*str*) – The file storing the configuration of potentials. - - - * **coeff_file** (*str*) – The file storing the coefficients of potentials. - - + * **param_file** (*str*) – The file storing the configuration of potentials. + * **coeff_file** (*str*) – The file storing the coefficients of potentials. * **Returns** -SNAPotential. + SNAPotential. #### pair_coeff(_ = ‘pair_coeff \* \* {coeff_file} {param_file} {elements}_ ) @@ -2982,31 +2383,19 @@ SNAPotential. Training data with models. - * **Parameters** - - * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. -energies ([float]): The list of total energies of each structure -in structures list. - - - * **train_energies** (*[**float**]*) – List of total energies of each structure in -structures list. - - - * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each -structure with m atoms in structures list. m can be varied with -each single structure case. - - - * **train_stresses** (*list*) – List of (6, ) virial stresses of each -structure in structures list. - - - * **include_stress** (*bool*) – Whether to include stress components. - - - * **stress_format** (*string*) – stress format, default to VASP + * **train_structures** (*[**Structure**]*) – The list of Pymatgen Structure object. + energies ([float]): The list of total energies of each structure + in structures list. + * **train_energies** (*[**float**]*) – List of total energies of each structure in + structures list. + * **train_forces** (*[**np.array**]*) – List of (m, 3) forces array of each + structure with m atoms in structures list. m can be varied with + each single structure case. + * **train_stresses** (*list*) – List of (6, ) virial stresses of each + structure in structures list. + * **include_stress** (*bool*) – Whether to include stress components. + * **stress_format** (*string*) – stress format, default to VASP #### write_param() diff --git a/docs/maml.apps.symbolic.md b/docs/maml.apps.symbolic.md index 11f65938..1a0ee077 100644 --- a/docs/maml.apps.symbolic.md +++ b/docs/maml.apps.symbolic.md @@ -14,19 +14,15 @@ Bases: `PenalizedLeastSquares` Adaptive lasso regression using OLS coefficients as the root-n estimator coefficients. -### _penalty_jac(x, y, beta) +### \_penalty_jac(x, y, beta) ### get_w(x, y) Get adaptive weights from data. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets Returns: coefficients array. @@ -34,16 +30,10 @@ Returns: coefficients array. Calculate the penalty from input x, output y and coefficient beta. - * **Parameters** - - * **beta** (*np.ndarray*) – N coefficients - - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets + * **beta** (*np.ndarray*) – N coefficients + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets Returns: penalty value. @@ -51,17 +41,11 @@ Returns: penalty value. Select feature indices from x. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets - - - * **options** (*dict*) – options in the optimizations provided -to scipy.optimize.minimize + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets + * **options** (*dict*) – options in the optimizations provided + to scipy.optimize.minimize Returns: list of int indices. @@ -78,16 +62,10 @@ and reference in [https://projecteuclid.org/download/pdfview_1/euclid.aos/120101 Get constraints dictionary from data, e.g., {“func”: lambda beta: fun(x, y, beta), “type”: “ineq”}. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets - - - * **beta** (*np.ndarray*) – placeholder + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets + * **beta** (*np.ndarray*) – placeholder Returns: dict of constraints. @@ -95,13 +73,9 @@ Returns: dict of constraints. Jacobian of cost functions. - * **Parameters** - - * **x** – ndarray - - - * **y** – ndarray + * **x** – ndarray + * **y** – ndarray Returns: callable @@ -109,16 +83,10 @@ Returns: callable Get loss function from data and tentative coefficients beta. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets - - - * **beta** (*np.ndarray*) – N coefficients + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets + * **beta** (*np.ndarray*) – N coefficients Returns: loss value. @@ -146,17 +114,11 @@ Iterative SIS. Evaluate the linear models using x, and y test data. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets - - - * **metric** (*str*) – scorer function, used with -sklearn.metrics.get_scorer + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets + * **metric** (*str*) – scorer function, used with + sklearn.metrics.get_scorer Returns: float. @@ -172,23 +134,14 @@ Run the ISIS :param metric: scorer function, used with > sklearn.metrics.get_scorer - - * **Parameters** - - * **options** – - - - * **step** (*float*) – step to update gamma with. - - + * **options** – + * **step** (*float*) – step to update gamma with. * **Returns** -np.array of index of selected features -coeff(np.array): np.array of coeff of selected features - - + np.array of index of selected features + coeff(np.array): np.array of coeff of selected features * **Return type** -find_sel(np.array) + find_sel(np.array) ## *class* maml.apps.symbolic.L0BrutalForce(lambd: float, \*\*kwargs) @@ -199,30 +152,20 @@ This method takes all possible combinations of features and optimize the following loss function > 1/2 \* mean((y-x @ beta)\*\*2) + lambd \* - > ```default > | > ``` - > beta|_0. ### select(x: np.ndarray, y: np.ndarray, options: dict | None = None, n_job: int = 1) L0 combinatorial optimization. - * **Parameters** - - * **x** (*np.ndarray*) – design matrix - - - * **y** (*np.ndarray*) – target vector - - - * **options** – Dict of options. - - - * **n_job** (*int*) – number of cpu + * **x** (*np.ndarray*) – design matrix + * **y** (*np.ndarray*) – target vector + * **options** – Dict of options. + * **n_job** (*int*) – number of cpu Returns: @@ -232,22 +175,16 @@ Bases: `PenalizedLeastSquares` Simple Lasso regression. -### _penalty_jac(x, y, beta) +### \_penalty_jac(x, y, beta) ### penalty(beta: np.ndarray, x: np.ndarray | None = None, y: np.ndarray | None = None) Calculate the penalty from input x, output y and coefficient beta. - * **Parameters** - - * **beta** (*np.ndarray*) – N coefficients - - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets + * **beta** (*np.ndarray*) – N coefficients + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets Returns: penalty value. @@ -292,25 +229,22 @@ Returns: name of the output True if the operator takes two arguments else False. - * **Type** -Returns + Returns ### *property* is_commutative(*: boo* ) True if the operator is commutative else False. - * **Type** -Returns + Returns ### *property* is_unary(*: boo* ) True if the operator takes one argument else False. - * **Type** -Returns + Returns ### support_op_rep(_ = [‘^2’, ‘^3’, ‘sqrt’, ‘abssqrt’, ‘cbrt’, ‘exp’, ‘abs’, ‘log10’, ‘abslog10’, ‘+’, ‘-’, ‘\*’, ‘/’, ‘|+|’, ‘|-|’, ‘sum_power_2’, ‘sum_exp’_ ) @@ -321,7 +255,7 @@ Bases: `PenalizedLeastSquares` Smoothly clipped absolute deviation (SCAD), equation 12 and 13 in [https://orfe.princeton.edu/~jqfan/papers/06/SIS.pdf](https://orfe.princeton.edu/~jqfan/papers/06/SIS.pdf). -### _penalty_jac(x, y, beta) +### \_penalty_jac(x, y, beta) ### penalty(beta: np.ndarray, x: np.ndarray | None = None, y: np.ndarray | None = None) @@ -331,16 +265,10 @@ Calculate the SCAD penalty from input x, output y and coefficient beta ``` - * **Parameters** - - * **beta** (*np.ndarray*) – N coefficients - - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets + * **beta** (*np.ndarray*) – N coefficients + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets Returns: penalty value. @@ -351,10 +279,7 @@ Bases: `object` Sure independence screening method. The method consists of two steps: -> > 1. Screen - -> > 1. Select. ### compute_residual(x, y) @@ -386,13 +311,9 @@ Returns: selected feature indices Simple screening method by comparing the correlation between features and the target. - * **Parameters** - - * **x** (*np.ndarray*) – input array - - - * **y** (*np.ndarray*) – target array + * **x** (*np.ndarray*) – input array + * **y** (*np.ndarray*) – target array Returns: top indices @@ -410,9 +331,8 @@ Select features using selectors Set gamma. - * **Parameters** -**gamma** (*float*) – new gamma value + **gamma** (*float*) – new gamma value ### set_selector(selector: BaseSelector) @@ -425,9 +345,8 @@ Set new selector Update the sis object so that sis.select return at least one feature. - * **Parameters** -**ratio** (*float*) – ratio to update the parameters + **ratio** (*float*) – ratio to update the parameters ## maml.apps.symbolic._feature_generator module @@ -488,25 +407,22 @@ Returns: name of the output True if the operator takes two arguments else False. - * **Type** -Returns + Returns #### *property* is_commutative(*: boo* ) True if the operator is commutative else False. - * **Type** -Returns + Returns #### *property* is_unary(*: boo* ) True if the operator takes one argument else False. - * **Type** -Returns + Returns #### support_op_rep(_ = [‘^2’, ‘^3’, ‘sqrt’, ‘abssqrt’, ‘cbrt’, ‘exp’, ‘abs’, ‘log10’, ‘abslog10’, ‘+’, ‘-’, ‘\*’, ‘/’, ‘|+|’, ‘|-|’, ‘sum_power_2’, ‘sum_exp’_ ) @@ -548,13 +464,9 @@ Helper function to update the dataframe with new generated feature array. Generate new features by applying operators to columns in feature_df. - * **Parameters** - - * **feature_df** (*pd.DataFrame*) – dataframe of original features - - - * **operators** (*list*) – list of str of operators (check Operator.support_op_rep for reference) + * **feature_df** (*pd.DataFrame*) – dataframe of original features + * **operators** (*list*) – list of str of operators (check Operator.support_op_rep for reference) Returns: dataframe of augmented features @@ -568,19 +480,15 @@ Bases: `PenalizedLeastSquares` Adaptive lasso regression using OLS coefficients as the root-n estimator coefficients. -#### _penalty_jac(x, y, beta) +#### \_penalty_jac(x, y, beta) #### get_w(x, y) Get adaptive weights from data. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets Returns: coefficients array. @@ -588,16 +496,10 @@ Returns: coefficients array. Calculate the penalty from input x, output y and coefficient beta. - * **Parameters** - - * **beta** (*np.ndarray*) – N coefficients - - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets + * **beta** (*np.ndarray*) – N coefficients + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets Returns: penalty value. @@ -605,17 +507,11 @@ Returns: penalty value. Select feature indices from x. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets - - - * **options** (*dict*) – options in the optimizations provided -to scipy.optimize.minimize + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets + * **options** (*dict*) – options in the optimizations provided + to scipy.optimize.minimize Returns: list of int indices. @@ -626,19 +522,15 @@ Bases: `object` Feature selector. This is meant to work on relatively smaller number of features. -#### *classmethod* _get_param_names() +#### *classmethod* \_get_param_names() #### compute_residual(x: ndarray, y: ndarray) Compute. - * **Parameters** - - * **x** (*np.ndarray*) – design matrix - - - * **y** (*np.ndarray*) – target vector + * **x** (*np.ndarray*) – design matrix + * **y** (*np.ndarray*) – target vector Returns: residual vector. @@ -647,16 +539,10 @@ Returns: residual vector. Get constraints dictionary from data, e.g., {“func”: lambda beta: fun(x, y, beta), “type”: “ineq”}. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets - - - * **beta** (*np.ndarray*) – parameter to optimize + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets + * **beta** (*np.ndarray*) – parameter to optimize Returns: dict of constraints. @@ -686,17 +572,11 @@ Returns: loss value. Evaluate the linear models using x, and y test data. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets - - - * **metric** (*str*) – scorer function, used with -sklearn.metrics.get_scorer + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets + * **metric** (*str*) – scorer function, used with + sklearn.metrics.get_scorer Returns: @@ -725,9 +605,8 @@ parameter names mapped to their values Predict the results using sparsified coefficients. - * **Parameters** -**x** (*np.ndarray*) – design matrix + **x** (*np.ndarray*) – design matrix Returns: ndarray @@ -750,13 +629,10 @@ Set the parameters of this selector :param \*\*params: dict :param Selector parameters.: - * **Returns** -selector instance - - + selector instance * **Return type** -self + self ### *class* maml.apps.symbolic._selectors.DantzigSelector(lambd, sigma=1.0, \*\*kwargs) @@ -771,16 +647,10 @@ and reference in [https://projecteuclid.org/download/pdfview_1/euclid.aos/120101 Get constraints dictionary from data, e.g., {“func”: lambda beta: fun(x, y, beta), “type”: “ineq”}. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets - - - * **beta** (*np.ndarray*) – placeholder + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets + * **beta** (*np.ndarray*) – placeholder Returns: dict of constraints. @@ -788,13 +658,9 @@ Returns: dict of constraints. Jacobian of cost functions. - * **Parameters** - - * **x** – ndarray - - - * **y** – ndarray + * **x** – ndarray + * **y** – ndarray Returns: callable @@ -802,16 +668,10 @@ Returns: callable Get loss function from data and tentative coefficients beta. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets - - - * **beta** (*np.ndarray*) – N coefficients + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets + * **beta** (*np.ndarray*) – N coefficients Returns: loss value. @@ -824,30 +684,20 @@ This method takes all possible combinations of features and optimize the following loss function > 1/2 \* mean((y-x @ beta)\*\*2) + lambd \* - > ```default > | > ``` - > beta|_0. #### select(x: np.ndarray, y: np.ndarray, options: dict | None = None, n_job: int = 1) L0 combinatorial optimization. - * **Parameters** - - * **x** (*np.ndarray*) – design matrix - - - * **y** (*np.ndarray*) – target vector - - - * **options** – Dict of options. - - - * **n_job** (*int*) – number of cpu + * **x** (*np.ndarray*) – design matrix + * **y** (*np.ndarray*) – target vector + * **options** – Dict of options. + * **n_job** (*int*) – number of cpu Returns: @@ -857,22 +707,16 @@ Bases: `PenalizedLeastSquares` Simple Lasso regression. -#### _penalty_jac(x, y, beta) +#### \_penalty_jac(x, y, beta) #### penalty(beta: np.ndarray, x: np.ndarray | None = None, y: np.ndarray | None = None) Calculate the penalty from input x, output y and coefficient beta. - * **Parameters** - - * **beta** (*np.ndarray*) – N coefficients - - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets + * **beta** (*np.ndarray*) – N coefficients + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets Returns: penalty value. @@ -883,9 +727,9 @@ Bases: `BaseSelector` Penalized least squares. In addition to minimizing the sum of squares loss, it adds an additional penalty to the coefficients. -#### _penalty_jac(x, y, beta) +#### \_penalty_jac(x, y, beta) -#### _sse_jac(x, y, beta) +#### \_sse_jac(x, y, beta) #### construct_constraints(x: np.ndarray, y: np.ndarray, beta: np.ndarray | None = None) @@ -940,7 +784,7 @@ Bases: `PenalizedLeastSquares` Smoothly clipped absolute deviation (SCAD), equation 12 and 13 in [https://orfe.princeton.edu/~jqfan/papers/06/SIS.pdf](https://orfe.princeton.edu/~jqfan/papers/06/SIS.pdf). -#### _penalty_jac(x, y, beta) +#### \_penalty_jac(x, y, beta) #### penalty(beta: np.ndarray, x: np.ndarray | None = None, y: np.ndarray | None = None) @@ -950,16 +794,10 @@ Calculate the SCAD penalty from input x, output y and coefficient beta ``` - * **Parameters** - - * **beta** (*np.ndarray*) – N coefficients - - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets + * **beta** (*np.ndarray*) – N coefficients + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets Returns: penalty value. @@ -1020,16 +858,10 @@ Base selector using cvxpy (CP). Get constraints dictionary from data, e.g., {“func”: lambda beta: fun(x, y, beta), “type”: “ineq”}. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets - - - * **beta** – (np.ndarray): target variable for optimization + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets + * **beta** – (np.ndarray): target variable for optimization Returns: dict of constraints. @@ -1154,17 +986,11 @@ Iterative SIS. Evaluate the linear models using x, and y test data. - * **Parameters** - - * **x** (*np.ndarray*) – MxN input data array - - - * **y** (*np.ndarray*) – M output targets - - - * **metric** (*str*) – scorer function, used with -sklearn.metrics.get_scorer + * **x** (*np.ndarray*) – MxN input data array + * **y** (*np.ndarray*) – M output targets + * **metric** (*str*) – scorer function, used with + sklearn.metrics.get_scorer Returns: float. @@ -1180,23 +1006,14 @@ Run the ISIS :param metric: scorer function, used with > sklearn.metrics.get_scorer - - * **Parameters** - - * **options** – - - - * **step** (*float*) – step to update gamma with. - - + * **options** – + * **step** (*float*) – step to update gamma with. * **Returns** -np.array of index of selected features -coeff(np.array): np.array of coeff of selected features - - + np.array of index of selected features + coeff(np.array): np.array of coeff of selected features * **Return type** -find_sel(np.array) + find_sel(np.array) ### *class* maml.apps.symbolic._sis.SIS(gamma=0.1, selector: BaseSelector | None = None, verbose: bool = True) @@ -1205,10 +1022,7 @@ Bases: `object` Sure independence screening method. The method consists of two steps: -> > 1. Screen - -> > 1. Select. #### compute_residual(x, y) @@ -1240,13 +1054,9 @@ Returns: selected feature indices Simple screening method by comparing the correlation between features and the target. - * **Parameters** - - * **x** (*np.ndarray*) – input array - - - * **y** (*np.ndarray*) – target array + * **x** (*np.ndarray*) – input array + * **y** (*np.ndarray*) – target array Returns: top indices @@ -1264,9 +1074,8 @@ Select features using selectors Set gamma. - * **Parameters** -**gamma** (*float*) – new gamma value + **gamma** (*float*) – new gamma value #### set_selector(selector: BaseSelector) @@ -1279,9 +1088,8 @@ Set new selector Update the sis object so that sis.select return at least one feature. - * **Parameters** -**ratio** (*float*) – ratio to update the parameters + **ratio** (*float*) – ratio to update the parameters ### maml.apps.symbolic._sis._best_combination(x, y, find_sel, find_sel_new, metric: str = ‘neg_mean_absolute_error’) diff --git a/docs/maml.base.md b/docs/maml.base.md index 0c8a00f7..0f423f9e 100644 --- a/docs/maml.base.md +++ b/docs/maml.base.md @@ -29,7 +29,7 @@ a list of DataFrame/numpy.ndarray. ### *abc_impl(* = <_abc.*abc_data object* ) -### _is_multi_output() +### \_is_multi_output() ### *sklearn_auto_wrap_output_keys(* = {‘transform’_ ) @@ -46,13 +46,9 @@ the feature dimension, e.g., MLP models. Place holder for fit API. - * **Parameters** - - * **x** – Any inputs - - - * **y** – Any outputs + * **x** – Any inputs + * **y** – Any outputs Returns: self @@ -61,13 +57,10 @@ Returns: self Transform a list of objs. If the return data is DataFrame, use df.xs(index, level=’input_index’) to get the result for the i-th object. - * **Parameters** -**objs** (*list*) – A list of objects. - - + **objs** (*list*) – A list of objects. * **Returns** -One or a list of pandas data frame/numpy ndarray + One or a list of pandas data frame/numpy ndarray ### transform_one(obj: Any) @@ -81,40 +74,27 @@ Abstract Base class for a Model. Basically, it usually wraps around a deep learning package, e.g., the Sequential Model in Keras, but provides for transparent conversion of arbitrary input and outputs. -### _predict(features: ndarray, \*\*kwargs) +### \_predict(features: ndarray, \*\*kwargs) Predict the values given a set of inputs based on fitted models. - * **Parameters** -**features** (*np.ndarray*) – array-like input features. - - + **features** (*np.ndarray*) – array-like input features. * **Returns** -List of output objects. + List of output objects. ### fit(features: list | np.ndarray, targets: list | np.ndarray | None = None, val_features: list | np.ndarray | None = None, val_targets: list | np.ndarray | None = None, \*\*kwargs) - * **Parameters** - - * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or -numpy array with dim (m, n) where m is the number of data and -n is the feature dimension. - - - * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or -numpy array with dim (m, ). - - - * **val_features** (*list*\* or \**np.ndarray*) – validation features - - - * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. - - + * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or + numpy array with dim (m, n) where m is the number of data and + n is the feature dimension. + * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or + numpy array with dim (m, ). + * **val_features** (*list*\* or \**np.ndarray*) – validation features + * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. * **Returns** -self + self ### predict_objs(objs: list | np.ndarray) @@ -128,22 +108,12 @@ Structure objects. Train the models from object, target pairs. - * **Parameters** - - * **objs** (*list*\* of \**objects*) – List of objects - - - * **targets** (*list*) – list of float or np.ndarray - - - * **val_objs** (*list*\* of \**objects*) – list of validation objects - - - * **val_targets** (*list*) – list of validation targets - - - * **\*\*kwargs** – + * **objs** (*list*\* of \**objects*) – List of objects + * **targets** (*list*) – list of float or np.ndarray + * **val_objs** (*list*\* of \**objects*) – list of validation objects + * **val_targets** (*list*) – list of validation targets + * **\*\*kwargs** – Returns: self @@ -161,9 +131,8 @@ Dummy Describer that does nothing. Does nothing but return the original features. - * **Parameters** -**obj** – Any inputs + **obj** – Any inputs Returns: Any outputs @@ -173,33 +142,23 @@ Bases: `BaseModel`, `KerasMixin` MAML models with keras models as estimators. -### *static* _get_validation_data(val_features, val_targets, \*\*val_kwargs) +### *static* \_get_validation_data(val_features, val_targets, \*\*val_kwargs) construct validation data, the default is just returning a list of val_features and val_targets. ### fit(features: list | np.ndarray, targets: list | np.ndarray | None = None, val_features: list | np.ndarray | None = None, val_targets: list | np.ndarray | None = None, \*\*kwargs) - * **Parameters** - - * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or -numpy array with dim (m, n) where m is the number of data and -n is the feature dimension. - - - * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or -numpy array with dim (m, ). - - - * **val_features** (*list*\* or \**np.ndarray*) – validation features - - - * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. - - + * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or + numpy array with dim (m, n) where m is the number of data and + n is the feature dimension. + * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or + numpy array with dim (m, ). + * **val_features** (*list*\* or \**np.ndarray*) – validation features + * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. * **Returns** -self + self ## *class* maml.base.SKLModel(model, describer: BaseDescriber | None = None, \*\*kwargs) @@ -235,22 +194,12 @@ Structure objects. Train the models from object, target pairs. - * **Parameters** - - * **objs** (*list*\* of \**objects*) – List of objects - - - * **targets** (*list*) – list of float or np.ndarray - - - * **val_objs** (*list*\* of \**objects*) – list of validation objects - - - * **val_targets** (*list*) – list of validation targets - - - * **\*\*kwargs** – + * **objs** (*list*\* of \**objects*) – List of objects + * **targets** (*list*) – list of float or np.ndarray + * **val_objs** (*list*\* of \**objects*) – list of validation objects + * **val_targets** (*list*) – list of validation targets + * **\*\*kwargs** – Returns: self @@ -258,13 +207,10 @@ Returns: self Decorate to set describers class type. - * **Parameters** -**dtype** (*str*) – describers type, e.g., site, composition, structure etc. - - + **dtype** (*str*) – describers type, e.g., site, composition, structure etc. * **Returns** -wrapped class + wrapped class ## maml.base.get_feature_batch(fb_name: str | Callable | None = None) @@ -319,7 +265,7 @@ a list of DataFrame/numpy.ndarray. #### *abc_impl(* = <_abc.*abc_data object* ) -#### _is_multi_output() +#### \_is_multi_output() #### *sklearn_auto_wrap_output_keys(* = {‘transform’_ ) @@ -336,13 +282,9 @@ the feature dimension, e.g., MLP models. Place holder for fit API. - * **Parameters** - - * **x** – Any inputs - - - * **y** – Any outputs + * **x** – Any inputs + * **y** – Any outputs Returns: self @@ -351,13 +293,10 @@ Returns: self Transform a list of objs. If the return data is DataFrame, use df.xs(index, level=’input_index’) to get the result for the i-th object. - * **Parameters** -**objs** (*list*) – A list of objects. - - + **objs** (*list*) – A list of objects. * **Returns** -One or a list of pandas data frame/numpy ndarray + One or a list of pandas data frame/numpy ndarray #### transform_one(obj: Any) @@ -377,9 +316,8 @@ Dummy Describer that does nothing. Does nothing but return the original features. - * **Parameters** -**obj** – Any inputs + **obj** – Any inputs Returns: Any outputs @@ -397,25 +335,19 @@ A thin wrapper of sklearn Pipeline. A wrapper to make a pure function. - * **Parameters** -**describer** (*BaseDescriber*) – a describers - - + **describer** (*BaseDescriber*) – a describers * **Returns** -np.ndarray + np.ndarray ### maml.base._describer.describer_type(dtype: str) Decorate to set describers class type. - * **Parameters** -**dtype** (*str*) – describers type, e.g., site, composition, structure etc. - - + **dtype** (*str*) – describers type, e.g., site, composition, structure etc. * **Returns** -wrapped class + wrapped class ## maml.base._feature_batch module @@ -483,22 +415,12 @@ Structure objects. Train the models from object, target pairs. - * **Parameters** - - * **objs** (*list*\* of \**objects*) – List of objects - - - * **targets** (*list*) – list of float or np.ndarray - - - * **val_objs** (*list*\* of \**objects*) – list of validation objects - - - * **val_targets** (*list*) – list of validation targets - - - * **\*\*kwargs** – + * **objs** (*list*\* of \**objects*) – List of objects + * **targets** (*list*) – list of float or np.ndarray + * **val_objs** (*list*\* of \**objects*) – list of validation objects + * **val_targets** (*list*) – list of validation targets + * **\*\*kwargs** – Returns: self @@ -514,40 +436,27 @@ Abstract Base class for a Model. Basically, it usually wraps around a deep learning package, e.g., the Sequential Model in Keras, but provides for transparent conversion of arbitrary input and outputs. -#### _predict(features: ndarray, \*\*kwargs) +#### \_predict(features: ndarray, \*\*kwargs) Predict the values given a set of inputs based on fitted models. - * **Parameters** -**features** (*np.ndarray*) – array-like input features. - - + **features** (*np.ndarray*) – array-like input features. * **Returns** -List of output objects. + List of output objects. #### fit(features: list | np.ndarray, targets: list | np.ndarray | None = None, val_features: list | np.ndarray | None = None, val_targets: list | np.ndarray | None = None, \*\*kwargs) - * **Parameters** - - * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or -numpy array with dim (m, n) where m is the number of data and -n is the feature dimension. - - - * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or -numpy array with dim (m, ). - - - * **val_features** (*list*\* or \**np.ndarray*) – validation features - - - * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. - - + * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or + numpy array with dim (m, n) where m is the number of data and + n is the feature dimension. + * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or + numpy array with dim (m, ). + * **val_features** (*list*\* or \**np.ndarray*) – validation features + * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. * **Returns** -self + self #### predict_objs(objs: list | np.ndarray) @@ -561,22 +470,12 @@ Structure objects. Train the models from object, target pairs. - * **Parameters** - - * **objs** (*list*\* of \**objects*) – List of objects - - - * **targets** (*list*) – list of float or np.ndarray - - - * **val_objs** (*list*\* of \**objects*) – list of validation objects - - - * **val_targets** (*list*) – list of validation targets - - - * **\*\*kwargs** – + * **objs** (*list*\* of \**objects*) – List of objects + * **targets** (*list*) – list of float or np.ndarray + * **val_objs** (*list*\* of \**objects*) – list of validation objects + * **val_targets** (*list*) – list of validation targets + * **\*\*kwargs** – Returns: self @@ -590,19 +489,11 @@ keras models mixin with save and load functionality. Evaluate objs, targets. - * **Parameters** - - * **eval_objs** (*list*) – objs for evaluation - - - * **eval_targets** (*list*) – target list for the corresponding objects - - - * **is_feature** (*bool*) – whether the input x is feature matrix - - - * **metric** (*callable*) – metric for evaluation + * **eval_objs** (*list*) – objs for evaluation + * **eval_targets** (*list*) – target list for the corresponding objects + * **is_feature** (*bool*) – whether the input x is feature matrix + * **metric** (*callable*) – metric for evaluation #### *classmethod* from_file(filename: str, \*\*kwargs) @@ -617,13 +508,9 @@ Returns: object instance Get feature dimension/input_dim from describers or input_dim. - * **Parameters** - - * **describer** (*Describer*) – describers - - - * **input_dim** (*int*) – optional input dim int + * **describer** (*Describer*) – describers + * **input_dim** (*int*) – optional input dim int #### load(filename: str, custom_objects: list | None = None) @@ -637,9 +524,8 @@ Returns: None Save the models and describers. - * **Parameters** -**filename** (*str*) – filename for save + **filename** (*str*) – filename for save ### *class* maml.base._model.KerasModel(model, describer: BaseDescriber | None = None, \*\*kwargs) @@ -647,33 +533,23 @@ Bases: `BaseModel`, `KerasMixin` MAML models with keras models as estimators. -#### *static* _get_validation_data(val_features, val_targets, \*\*val_kwargs) +#### *static* \_get_validation_data(val_features, val_targets, \*\*val_kwargs) construct validation data, the default is just returning a list of val_features and val_targets. #### fit(features: list | np.ndarray, targets: list | np.ndarray | None = None, val_features: list | np.ndarray | None = None, val_targets: list | np.ndarray | None = None, \*\*kwargs) - * **Parameters** - - * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or -numpy array with dim (m, n) where m is the number of data and -n is the feature dimension. - - - * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or -numpy array with dim (m, ). - - - * **val_features** (*list*\* or \**np.ndarray*) – validation features - - - * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. - - + * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or + numpy array with dim (m, n) where m is the number of data and + n is the feature dimension. + * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or + numpy array with dim (m, ). + * **val_features** (*list*\* or \**np.ndarray*) – validation features + * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. * **Returns** -self + self ### *class* maml.base._model.SKLModel(model, describer: BaseDescriber | None = None, \*\*kwargs) @@ -691,19 +567,11 @@ Sklearn models save and load functionality. Evaluate objs, targets. - * **Parameters** - - * **eval_objs** (*list*) – objs for evaluation - - - * **eval_targets** (*list*) – target list for the corresponding objects - - - * **is_feature** (*bool*) – whether the input x is feature matrix - - - * **metric** (*callable*) – metric for evaluation + * **eval_objs** (*list*) – objs for evaluation + * **eval_targets** (*list*) – target list for the corresponding objects + * **is_feature** (*bool*) – whether the input x is feature matrix + * **metric** (*callable*) – metric for evaluation #### *classmethod* from_file(filename: str, \*\*kwargs) @@ -726,9 +594,8 @@ Returns: None Save the models and describers. - * **Parameters** -**filename** (*str*) – filename for save + **filename** (*str*) – filename for save ### maml.base._model.is_keras_model(model: BaseModel) diff --git a/docs/maml.data.md b/docs/maml.data.md index 661065f2..842e4c2d 100644 --- a/docs/maml.data.md +++ b/docs/maml.data.md @@ -16,17 +16,11 @@ Query the Materials Project for Data. ### get(criteria: str | dict, properties: list[str]) - * **Parameters** - - * **criteria** (*str*\* or \**dict*) – Criteria for query - - - * **properties** (*list*) – Properties to be queried. - - + * **criteria** (*str*\* or \**dict*) – Criteria for query + * **properties** (*list*) – Properties to be queried. * **Returns** -pandas DataFrame + pandas DataFrame ## *class* maml.data.URLSource(fmt: str = ‘csv’, read_kwargs=None) @@ -38,13 +32,10 @@ Load raw data from a URL, e.g., figshare. Get url data source. - * **Parameters** -**url** – URL to obtain raw data from. - - + **url** – URL to obtain raw data from. * **Returns** -pd.DataFrame + pd.DataFrame ## maml.data._mp module @@ -58,17 +49,11 @@ Query the Materials Project for Data. #### get(criteria: str | dict, properties: list[str]) - * **Parameters** - - * **criteria** (*str*\* or \**dict*) – Criteria for query - - - * **properties** (*list*) – Properties to be queried. - - + * **criteria** (*str*\* or \**dict*) – Criteria for query + * **properties** (*list*) – Properties to be queried. * **Returns** -pandas DataFrame + pandas DataFrame ## maml.data._url module @@ -85,9 +70,8 @@ Load data from figshare. Get data from Figshare :param file_id: file id. - * **Returns** -data frame + data frame ### *class* maml.data._url.URLSource(fmt: str = ‘csv’, read_kwargs=None) @@ -99,10 +83,7 @@ Load raw data from a URL, e.g., figshare. Get url data source. - * **Parameters** -**url** – URL to obtain raw data from. - - + **url** – URL to obtain raw data from. * **Returns** -pd.DataFrame \ No newline at end of file + pd.DataFrame \ No newline at end of file diff --git a/docs/maml.describers.md b/docs/maml.describers.md index e4a22ed7..3ceae363 100644 --- a/docs/maml.describers.md +++ b/docs/maml.describers.md @@ -20,11 +20,9 @@ Reference: @article{behler2007generalized, > title={Generalized neural-network representation of - > ```none > high-dimensional potential-energy surfaces}, > ``` - > author={Behler, J{“o}rg and Parrinello, Michele}, > journal={Physical review letters}, > volume={98}, @@ -35,13 +33,12 @@ Reference: ### *abc_impl(* = <_abc.*abc_data object* ) -### _fc(r: float) +### \_fc(r: float) Cutoff function to decay the symmetry functions at vicinity of radial cutoff. - * **Parameters** -**r** (*float*) – The pair distance. + **r** (*float*) – The pair distance. ### *sklearn_auto_wrap_output_keys(* = {‘transform’_ ) @@ -49,9 +46,8 @@ Cutoff function to decay the symmetry functions at vicinity of radial cutoff. ### transform_one(structure: Structure) - * **Parameters** -**structure** (*Structure*) – Pymatgen Structure object. + **structure** (*Structure*) – Pymatgen Structure object. ## *class* maml.describers.BispectrumCoefficients(rcutfac: float, twojmax: int, element_profile: dict, quadratic: bool = False, pot_fit: bool = False, include_stress: bool = False, feature_batch: str = ‘pandas_concat’, \*\*kwargs) @@ -64,17 +60,13 @@ Reference: @article{bartok2010gaussian, > title={Gaussian approximation potentials: The - > ```none > accuracy of quantum mechanics, without the electrons}, > ``` - > author={Bart{‘o}k, Albert P and Payne, Mike C - > ```none > and Kondor, Risi and Cs{'a}nyi, G{'a}bor}, > ``` - > journal={Physical review letters}, > volume={104}, number={13}, pages={136403}, year={2010}, publisher={APS}} @@ -95,9 +87,8 @@ involved. ### transform_one(structure: Structure) - * **Parameters** -**structure** (*Structure*) – Pymatgen Structure object. + **structure** (*Structure*) – Pymatgen Structure object. ## *class* maml.describers.CoulombEigenSpectrum(max_atoms: int | None = None, \*\*kwargs) @@ -109,17 +100,13 @@ Reference: @article{rupp2012fast, > title={Fast and accurate modeling of molecular - > ```none > atomization energies with machine learning}, > ``` - > author={Rupp, Matthias and Tkatchenko, Alexandre and M{“u}ller, - > ```none > Klaus-Robert and Von Lilienfeld, O Anatole}, > ``` - > journal={Physical review letters}, volume={108}, > number={5}, pages={058301}, > year={2012}, publisher={APS}} @@ -132,9 +119,8 @@ Reference: ### transform_one(mol: Molecule) - * **Parameters** -**mol** (*Molecule*) – pymatgen molecule. + **mol** (*Molecule*) – pymatgen molecule. Returns: np.ndarray the eigen value vectors of Coulob matrix @@ -148,33 +134,26 @@ Reference: @article{rupp2012fast, > title={Fast and accurate modeling of molecular - > ```none > atomization energies with machine learning}, > ``` - > author={Rupp, Matthias and Tkatchenko, Alexandre and M{“u}ller, - > ```none > Klaus-Robert and Von Lilienfeld, O Anatole}, > ``` - > journal={Physical review letters}, volume={108}, > number={5}, pages={058301}, > year={2012}, publisher={APS}} ### *abc_impl(* = <_abc.*abc_data object* ) -### *static* _get_columb_mat(s: Molecule | Structure) - +### *static* \_get_columb_mat(s: Molecule | Structure) * **Parameters** -**s** (*Molecule/Structure*) – input Molecule or Structure. Structure -is not advised since the feature will depend on the supercell size. - - + **s** (*Molecule/Structure*) – input Molecule or Structure. Structure + is not advised since the feature will depend on the supercell size. * **Returns** -Coulomb matrix of the structure + Coulomb matrix of the structure ### *sklearn_auto_wrap_output_keys(* = {‘transform’_ ) @@ -182,27 +161,21 @@ Coulomb matrix of the structure ### get_coulomb_mat(s: Molecule | Structure) - * **Parameters** -**s** (*Molecule/Structure*) – input Molecule or Structure. Structure -is not advised since the feature will depend on the supercell size - - + **s** (*Molecule/Structure*) – input Molecule or Structure. Structure + is not advised since the feature will depend on the supercell size * **Returns** -Coulomb matrix of the structure. + Coulomb matrix of the structure. ### transform_one(s: Molecule | Structure) - * **Parameters** -**s** (*Molecule/Structure*) – pymatgen Molecule or Structure, Structure is not -advised since the features will depend on supercell size. - - + **s** (*Molecule/Structure*) – pymatgen Molecule or Structure, Structure is not + advised since the features will depend on supercell size. * **Returns** -pandas.DataFrame. -The column is index of the structure, which is 0 for single input -df[0] returns the serials of coulomb_mat raval + pandas.DataFrame. + The column is index of the structure, which is 0 for single input + df[0] returns the serials of coulomb_mat raval ## *class* maml.describers.DistinctSiteProperty(properties: list[str], symprec: float = 0.1, wyckoffs: list[str] | None = None, feature_batch: str = ‘pandas_concat’, \*\*kwargs) @@ -217,9 +190,7 @@ Reference: > title={Deep neural networks for accurate predictions of crystal stability}, > author={Ye, Weike and Chen, Chi and Wang, Zhenbin and - > > Chu, Iek-Heng and Ong, Shyue Ping}, - > journal={Nature communications}, > volume={9}, > number={1}, @@ -237,13 +208,10 @@ Reference: ### transform_one(structure: Structure) - * **Parameters** -**structure** (*pymatgen Structure*) – pymatgen structure for descriptor computation. - - + **structure** (*pymatgen Structure*) – pymatgen structure for descriptor computation. * **Returns** -pd.DataFrame that contains the distinct position labeled features + pd.DataFrame that contains the distinct position labeled features ## *class* maml.describers.ElementProperty(\*args, \*\*kwargs) @@ -267,24 +235,18 @@ list of all attributes available for a given data_source, see the documentation for the data sources (e.g., PymatgenData, MagpieData, MatscholarElementData, etc.). - * **Parameters** - - * **data_source** (*AbstractData*\* or \**str*) – source from which to retrieve -element property data (or use str for preset: “pymatgen”, -“magpie”, or “deml”) - - - * **features** (*list*\* of \**strings*) – List of elemental properties to use -(these must be supported by data_source) - - - * **stats** (*list*\* of \**strings*) – a list of weighted statistics to compute to for each -property (see PropertyStats for available stats) + * **data_source** (*AbstractData*\* or \**str*) – source from which to retrieve + element property data (or use str for preset: “pymatgen”, + “magpie”, or “deml”) + * **features** (*list*\* of \**strings*) – List of elemental properties to use + (these must be supported by data_source) + * **stats** (*list*\* of \**strings*) – a list of weighted statistics to compute to for each + property (see PropertyStats for available stats) ### *abc_impl(* = <_abc.*abc_data object* ) -### *classmethod* _get_param_names() +### *classmethod* \_get_param_names() Get parameter names for the estimator @@ -300,18 +262,13 @@ Wrap matminer_wrapper’s from_preset function. Get parameters for this estimator. - * **Parameters** -**deep** (*bool*\*, \**default=True*) – If True, will return the parameters for this estimator and -contained subobjects that are estimators. - - + **deep** (*bool*\*, \**default=True*) – If True, will return the parameters for this estimator and + contained subobjects that are estimators. * **Returns** -**params** – Parameter names mapped to their values. - - + **params** – Parameter names mapped to their values. * **Return type** -dict + dict ### transform_one(obj: Any) @@ -331,27 +288,17 @@ are separated by ::, e.g., moment::1::None. ### *abc_impl(* = <_abc.*abc_data object* ) -### *static* _reduce_dimension(element_properties, property_names, num_dim: int | None = None, reduction_algo: str | None = ‘pca’, reduction_params: dict | None = None) +### *static* \_reduce_dimension(element_properties, property_names, num_dim: int | None = None, reduction_algo: str | None = ‘pca’, reduction_params: dict | None = None) Reduce the feature dimension by reduction_algo. - * **Parameters** - - * **element_properties** (*dict*) – dictionary of elemental/specie propeprties - - - * **property_names** (*list*) – list of property names - - - * **num_dim** (*int*) – number of dimension to keep - - - * **reduction_algo** (*str*) – algorithm for dimensional reduction, currently support -pca, kpca - - - * **reduction_params** (*dict*) – kwargs for reduction algorithm + * **element_properties** (*dict*) – dictionary of elemental/specie propeprties + * **property_names** (*list*) – list of property names + * **num_dim** (*int*) – number of dimension to keep + * **reduction_algo** (*str*) – algorithm for dimensional reduction, currently support + pca, kpca + * **reduction_params** (*dict*) – kwargs for reduction algorithm Returns: new element_properties and property_names @@ -363,18 +310,12 @@ Returns: new element_properties and property_names ElementalStats from existing data file. - * **Parameters** - - * **data_name** (*str*\* of **list** of \**str*) – data name. Current supported data are -available from ElementStats.AVAILABLE_DATA - - - * **stats** (*list*) – list of stats, use ElementStats.ALLOWED_STATS to -check available stats - - - * **\*\*kwargs** – Passthrough to class init. + * **data_name** (*str*\* of **list** of \**str*) – data name. Current supported data are + available from ElementStats.AVAILABLE_DATA + * **stats** (*list*) – list of stats, use ElementStats.ALLOWED_STATS to + check available stats + * **\*\*kwargs** – Passthrough to class init. Returns: ElementStats instance @@ -386,21 +327,14 @@ The keys required are: > element_properties > property_names - - * **Parameters** - - * **filename** (*str*) – filename - - - * **stats** (*list*) – list of stats, check ElementStats.ALLOWED_STATS -for supported stats. The stats that support additional -Keyword args, use ‘:’ to separate the args. For example, -‘moment:0:None’ will calculate moment stats with order=0, -and max_order=None. - - - * **\*\*kwargs** – Passthrough to class init. + * **filename** (*str*) – filename + * **stats** (*list*) – list of stats, check ElementStats.ALLOWED_STATS + for supported stats. The stats that support additional + Keyword args, use ‘:’ to separate the args. For example, + ‘moment:0:None’ will calculate moment stats with order=0, + and max_order=None. + * **\*\*kwargs** – Passthrough to class init. Returns: ElementStats class @@ -408,9 +342,8 @@ Returns: ElementStats class Transform one object, the object can be string, Compostion or Structure. - * **Parameters** -**obj** (*str/Composition/Structure*) – object to transform + **obj** (*str/Composition/Structure*) – object to transform Returns: pd.DataFrame with property names as column names @@ -440,13 +373,10 @@ Reference: @article{chen2019graph,title={Graph networks as a universal machine > > learning framework for molecules and crystals}, - > author={Chen, Chi and Ye, Weike and Zuo, Yunxing and - > ```none > Zheng, Chen and Ong, Shyue Ping}, > ``` - > journal={Chemistry of Materials}, volume={31}, number={9}, > pages={3564–3572}, year={2019},publisher={ACS Publications}} @@ -460,9 +390,8 @@ Reference: Get megnet site features from structure object. - * **Parameters** -**obj** (*structure*\* or \**molecule*) – pymatgen structure or molecules + **obj** (*structure*\* or \**molecule*) – pymatgen structure or molecules Returns: @@ -489,13 +418,10 @@ Reference: @article{chen2019graph,title={Graph networks as a universal machine > > learning framework for molecules and crystals}, - > author={Chen, Chi and Ye, Weike and Zuo, Yunxing and - > ```none > Zheng, Chen and Ong, Shyue Ping}, > ``` - > journal={Chemistry of Materials}, volume={31}, number={9}, > pages={3564–3572}, year={2019},publisher={ACS Publications}} @@ -519,7 +445,7 @@ Bases: `object` Calculator for radial distribution function. -### *static* _get_specie_density(structure: Structure) +### *static* \_get_specie_density(structure: Structure) ### get_site_coordination(structure: Structure) @@ -531,15 +457,12 @@ Returns: r, cns where cns is a list of dictionary with specie_pair: pair_cn key: ### get_site_rdf(structure: Structure) - * **Parameters** -**structure** (*Structure*) – pymatgen structure - - + **structure** (*Structure*) – pymatgen structure * **Returns** -r, rdfs, r is the radial points, and rdfs are a list of rdf dicts -rdfs[0] is the rdfs of the first site. It is a dictionary of {atom_pair: pair_rdf} -e.g., + r, rdfs, r is the radial points, and rdfs are a list of rdf dicts + rdfs[0] is the rdfs of the first site. It is a dictionary of {atom_pair: pair_rdf} + e.g., > {“Sr:O”: [0, 0, 0.1, 0.2, ..]}. @@ -551,11 +474,9 @@ Get specie-wise coordination number :param ref_species: the reference species. > The rdfs are calculated with these species at the center - - * **Parameters** -**species** (*list*\* of **species** or \**just single specie str*) – the species that we are interested in. -The rdfs are calculated on these species. + **species** (*list*\* of **species** or \**just single specie str*) – the species that we are interested in. + The rdfs are calculated on these species. Returns: @@ -567,11 +488,9 @@ Get specie-wise rdf :param ref_species: the reference species. > The rdfs are calculated with these species at the center - - * **Parameters** -**species** (*list*\* of **species** or \**just single specie str*) – the species that we are interested in. -The rdfs are calculated on these species. + **species** (*list*\* of **species** or \**just single specie str*) – the species that we are interested in. + The rdfs are calculated on these species. Returns: @@ -585,19 +504,15 @@ Reference: @article{montavon2013machine, > title={Machine learning of molecular electronic properties - > ```none > in chemical compound space}, > ``` - > author={Montavon, Gr{‘e}goire and Rupp, Matthias and Gobre, - > ```none > Vivekanand and Vazquez-Mayagoitia, Alvaro and Hansen, Katja > and Tkatchenko, Alexandre and M{"u}ller, Klaus-Robert and > Von Lilienfeld, O Anatole}, > ``` - > journal={New Journal of Physics}, > volume={15}, number={9},pages={095003}, > year={2013},publisher={IOP Publishing}} @@ -616,20 +531,14 @@ Returns the randomized matrix (iii) draw a zero-mean unit-variance noise vector ε of the same > size as row_norms. - - 1. permute the rows and columns of C with the same permutation > that sorts row_norms + ε. - - * **Parameters** -**s** (*Molecule/Structure*) – pymatgen Molecule or Structure, Structure is not -advised since the features will depend on supercell size - - + **s** (*Molecule/Structure*) – pymatgen Molecule or Structure, Structure is not + advised since the features will depend on supercell size * **Returns** -pd.DataFrame randomized Coulomb matrix + pd.DataFrame randomized Coulomb matrix ### transform_one(s: Molecule | Structure) @@ -649,7 +558,7 @@ an unordered set of site specie properties. ### *abc_impl(* = <_abc.*abc_data object* ) -### *static* _get_keys(c: Composition) +### *static* \_get_keys(c: Composition) ### *sklearn_auto_wrap_output_keys(* = {‘transform’_ ) @@ -663,13 +572,10 @@ Feature dimension. Transform one object to features. - * **Parameters** -**obj** (*str/Composition/Structure/Molecule*) – object to transform - - + **obj** (*str/Composition/Structure/Molecule*) – object to transform * **Returns** -features array + features array ## *class* maml.describers.SmoothOverlapAtomicPosition(cutoff: float, l_max: int = 8, n_max: int = 8, atom_sigma: float = 0.5, feature_batch: str = ‘pandas_concat’, \*\*kwargs) @@ -694,9 +600,8 @@ Reference: ### transform_one(structure: Structure) - * **Parameters** -**structure** (*Structure*) – Pymatgen Structure object. + **structure** (*Structure*) – Pymatgen Structure object. ## *class* maml.describers.SortedCoulombMatrix(random_seed: int | None = None, is_ravel: bool = True, \*\*kwargs) @@ -708,19 +613,15 @@ Reference: @inproceedings{montavon2012learning, > title={Learning invariant representations - > ```none > of molecules for atomization energy prediction}, > ``` - > author={Montavon, Gr{‘e}goire and Hansen, Katja - > ```none > and Fazli, Siamac and Rupp, Matthias and Biegler, > Franziska and Ziehe, Andreas and Tkatchenko, Alexandre > and Lilienfeld, Anatole V and M{"u}ller, Klaus-Robert}, > ``` - > booktitle={Advances in neural information processing systems}, > pages={440–448}, year={2012}} @@ -734,14 +635,11 @@ Reference: Returns the matrix sorted by the row norm. - * **Parameters** -**s** (*Molecule/Structure*) – pymatgen Molecule or Structure, Structure is not -advised since the features will depend on supercell size - - + **s** (*Molecule/Structure*) – pymatgen Molecule or Structure, Structure is not + advised since the features will depend on supercell size * **Returns** -pd.DataFrame, sorted Coulomb matrix + pd.DataFrame, sorted Coulomb matrix ### transform_one(s: Molecule | Structure) @@ -756,20 +654,12 @@ Returns: pd.DataFrame descriptors Wrapper of matminer_wrapper describers. - * **Parameters** - - * **cls_name** (*str*) – new class name - - - * **wrapped_class** (*class object*) – matminer_wrapper BaseFeaturizer - - - * **obj_conversion** (*callable*) – function to convert objects into desired -object type within transform_one - - - * **describer_type** (*object*) – object type. + * **cls_name** (*str*) – new class name + * **wrapped_class** (*class object*) – matminer_wrapper BaseFeaturizer + * **obj_conversion** (*callable*) – function to convert objects into desired + object type within transform_one + * **describer_type** (*object*) – object type. Returns: maml describers class @@ -791,27 +681,17 @@ are separated by ::, e.g., moment::1::None. #### *abc_impl(* = <_abc.*abc_data object* ) -#### *static* _reduce_dimension(element_properties, property_names, num_dim: int | None = None, reduction_algo: str | None = ‘pca’, reduction_params: dict | None = None) +#### *static* \_reduce_dimension(element_properties, property_names, num_dim: int | None = None, reduction_algo: str | None = ‘pca’, reduction_params: dict | None = None) Reduce the feature dimension by reduction_algo. - * **Parameters** - - * **element_properties** (*dict*) – dictionary of elemental/specie propeprties - - - * **property_names** (*list*) – list of property names - - - * **num_dim** (*int*) – number of dimension to keep - - - * **reduction_algo** (*str*) – algorithm for dimensional reduction, currently support -pca, kpca - - - * **reduction_params** (*dict*) – kwargs for reduction algorithm + * **element_properties** (*dict*) – dictionary of elemental/specie propeprties + * **property_names** (*list*) – list of property names + * **num_dim** (*int*) – number of dimension to keep + * **reduction_algo** (*str*) – algorithm for dimensional reduction, currently support + pca, kpca + * **reduction_params** (*dict*) – kwargs for reduction algorithm Returns: new element_properties and property_names @@ -823,18 +703,12 @@ Returns: new element_properties and property_names ElementalStats from existing data file. - * **Parameters** - - * **data_name** (*str*\* of **list** of \**str*) – data name. Current supported data are -available from ElementStats.AVAILABLE_DATA - - - * **stats** (*list*) – list of stats, use ElementStats.ALLOWED_STATS to -check available stats - - - * **\*\*kwargs** – Passthrough to class init. + * **data_name** (*str*\* of **list** of \**str*) – data name. Current supported data are + available from ElementStats.AVAILABLE_DATA + * **stats** (*list*) – list of stats, use ElementStats.ALLOWED_STATS to + check available stats + * **\*\*kwargs** – Passthrough to class init. Returns: ElementStats instance @@ -846,21 +720,14 @@ The keys required are: > element_properties > property_names - - * **Parameters** - - * **filename** (*str*) – filename - - - * **stats** (*list*) – list of stats, check ElementStats.ALLOWED_STATS -for supported stats. The stats that support additional -Keyword args, use ‘:’ to separate the args. For example, -‘moment:0:None’ will calculate moment stats with order=0, -and max_order=None. - - - * **\*\*kwargs** – Passthrough to class init. + * **filename** (*str*) – filename + * **stats** (*list*) – list of stats, check ElementStats.ALLOWED_STATS + for supported stats. The stats that support additional + Keyword args, use ‘:’ to separate the args. For example, + ‘moment:0:None’ will calculate moment stats with order=0, + and max_order=None. + * **\*\*kwargs** – Passthrough to class init. Returns: ElementStats class @@ -868,9 +735,8 @@ Returns: ElementStats class Transform one object, the object can be string, Compostion or Structure. - * **Parameters** -**obj** (*str/Composition/Structure*) – object to transform + **obj** (*str/Composition/Structure*) – object to transform Returns: pd.DataFrame with property names as column names @@ -904,20 +770,12 @@ Wrapper for matminer_wrapper featurizers. Wrapper of matminer_wrapper describers. - * **Parameters** - - * **cls_name** (*str*) – new class name - - - * **wrapped_class** (*class object*) – matminer_wrapper BaseFeaturizer - - - * **obj_conversion** (*callable*) – function to convert objects into desired -object type within transform_one - - - * **describer_type** (*object*) – object type. + * **cls_name** (*str*) – new class name + * **wrapped_class** (*class object*) – matminer_wrapper BaseFeaturizer + * **obj_conversion** (*callable*) – function to convert objects into desired + object type within transform_one + * **describer_type** (*object*) – object type. Returns: maml describers class @@ -941,13 +799,10 @@ Reference: @article{chen2019graph,title={Graph networks as a universal machine > > learning framework for molecules and crystals}, - > author={Chen, Chi and Ye, Weike and Zuo, Yunxing and - > ```none > Zheng, Chen and Ong, Shyue Ping}, > ``` - > journal={Chemistry of Materials}, volume={31}, number={9}, > pages={3564–3572}, year={2019},publisher={ACS Publications}} @@ -961,9 +816,8 @@ Reference: Get megnet site features from structure object. - * **Parameters** -**obj** (*structure*\* or \**molecule*) – pymatgen structure or molecules + **obj** (*structure*\* or \**molecule*) – pymatgen structure or molecules Returns: @@ -990,13 +844,10 @@ Reference: @article{chen2019graph,title={Graph networks as a universal machine > > learning framework for molecules and crystals}, - > author={Chen, Chi and Ye, Weike and Zuo, Yunxing and - > ```none > Zheng, Chen and Ong, Shyue Ping}, > ``` - > journal={Chemistry of Materials}, volume={31}, number={9}, > pages={3564–3572}, year={2019},publisher={ACS Publications}} @@ -1027,7 +878,7 @@ Bases: `object` Calculator for radial distribution function. -#### *static* _get_specie_density(structure: Structure) +#### *static* \_get_specie_density(structure: Structure) #### get_site_coordination(structure: Structure) @@ -1039,15 +890,12 @@ Returns: r, cns where cns is a list of dictionary with specie_pair: pair_cn key: #### get_site_rdf(structure: Structure) - * **Parameters** -**structure** (*Structure*) – pymatgen structure - - + **structure** (*Structure*) – pymatgen structure * **Returns** -r, rdfs, r is the radial points, and rdfs are a list of rdf dicts -rdfs[0] is the rdfs of the first site. It is a dictionary of {atom_pair: pair_rdf} -e.g., + r, rdfs, r is the radial points, and rdfs are a list of rdf dicts + rdfs[0] is the rdfs of the first site. It is a dictionary of {atom_pair: pair_rdf} + e.g., > {“Sr:O”: [0, 0, 0.1, 0.2, ..]}. @@ -1059,11 +907,9 @@ Get specie-wise coordination number :param ref_species: the reference species. > The rdfs are calculated with these species at the center - - * **Parameters** -**species** (*list*\* of **species** or \**just single specie str*) – the species that we are interested in. -The rdfs are calculated on these species. + **species** (*list*\* of **species** or \**just single specie str*) – the species that we are interested in. + The rdfs are calculated on these species. Returns: @@ -1075,11 +921,9 @@ Get specie-wise rdf :param ref_species: the reference species. > The rdfs are calculated with these species at the center - - * **Parameters** -**species** (*list*\* of **species** or \**just single specie str*) – the species that we are interested in. -The rdfs are calculated on these species. + **species** (*list*\* of **species** or \**just single specie str*) – the species that we are interested in. + The rdfs are calculated on these species. Returns: @@ -1093,9 +937,8 @@ Convert a distance array for counts in the bin :param r_max: maximum radius :type r_max: float - * **Returns** -1D array of counts in the bins centered on grid. + 1D array of counts in the bins centered on grid. ### maml.describers._rdf.get_pair_distances(structure: Structure, r_max: float = 8.0) @@ -1108,13 +951,9 @@ The output will be a list of of dictionary, for example it will be fairly easy to construct radial distribution func, etc from here. - * **Parameters** - - * **structure** (*Structure*) – pymatgen Structure - - - * **r_max** (*float*) – maximum radius to consider + * **structure** (*Structure*) – pymatgen Structure + * **r_max** (*float*) – maximum radius to consider Returns: @@ -1133,11 +972,9 @@ Reference: @article{behler2007generalized, > title={Generalized neural-network representation of - > ```none > high-dimensional potential-energy surfaces}, > ``` - > author={Behler, J{“o}rg and Parrinello, Michele}, > journal={Physical review letters}, > volume={98}, @@ -1148,13 +985,12 @@ Reference: #### *abc_impl(* = <_abc.*abc_data object* ) -#### _fc(r: float) +#### \_fc(r: float) Cutoff function to decay the symmetry functions at vicinity of radial cutoff. - * **Parameters** -**r** (*float*) – The pair distance. + **r** (*float*) – The pair distance. #### *sklearn_auto_wrap_output_keys(* = {‘transform’_ ) @@ -1162,9 +998,8 @@ Cutoff function to decay the symmetry functions at vicinity of radial cutoff. #### transform_one(structure: Structure) - * **Parameters** -**structure** (*Structure*) – Pymatgen Structure object. + **structure** (*Structure*) – Pymatgen Structure object. ### *class* maml.describers._site.BispectrumCoefficients(rcutfac: float, twojmax: int, element_profile: dict, quadratic: bool = False, pot_fit: bool = False, include_stress: bool = False, feature_batch: str = ‘pandas_concat’, \*\*kwargs) @@ -1177,17 +1012,13 @@ Reference: @article{bartok2010gaussian, > title={Gaussian approximation potentials: The - > ```none > accuracy of quantum mechanics, without the electrons}, > ``` - > author={Bart{‘o}k, Albert P and Payne, Mike C - > ```none > and Kondor, Risi and Cs{'a}nyi, G{'a}bor}, > ``` - > journal={Physical review letters}, > volume={104}, number={13}, pages={136403}, year={2010}, publisher={APS}} @@ -1208,9 +1039,8 @@ involved. #### transform_one(structure: Structure) - * **Parameters** -**structure** (*Structure*) – Pymatgen Structure object. + **structure** (*Structure*) – Pymatgen Structure object. ### *class* maml.describers._site.MEGNetSite(name: str | object | None = None, level: int | None = None, \*\*kwargs) @@ -1222,13 +1052,10 @@ Reference: @article{chen2019graph,title={Graph networks as a universal machine > > learning framework for molecules and crystals}, - > author={Chen, Chi and Ye, Weike and Zuo, Yunxing and - > ```none > Zheng, Chen and Ong, Shyue Ping}, > ``` - > journal={Chemistry of Materials}, volume={31}, number={9}, > pages={3564–3572}, year={2019},publisher={ACS Publications}} @@ -1242,9 +1069,8 @@ Reference: Get megnet site features from structure object. - * **Parameters** -**obj** (*structure*\* or \**molecule*) – pymatgen structure or molecules + **obj** (*structure*\* or \**molecule*) – pymatgen structure or molecules Returns: @@ -1257,7 +1083,7 @@ an unordered set of site specie properties. #### *abc_impl(* = <_abc.*abc_data object* ) -#### *static* _get_keys(c: Composition) +#### *static* \_get_keys(c: Composition) #### *sklearn_auto_wrap_output_keys(* = {‘transform’_ ) @@ -1271,13 +1097,10 @@ Feature dimension. Transform one object to features. - * **Parameters** -**obj** (*str/Composition/Structure/Molecule*) – object to transform - - + **obj** (*str/Composition/Structure/Molecule*) – object to transform * **Returns** -features array + features array ### *class* maml.describers._site.SmoothOverlapAtomicPosition(cutoff: float, l_max: int = 8, n_max: int = 8, atom_sigma: float = 0.5, feature_batch: str = ‘pandas_concat’, \*\*kwargs) @@ -1302,9 +1125,8 @@ Reference: #### transform_one(structure: Structure) - * **Parameters** -**structure** (*Structure*) – Pymatgen Structure object. + **structure** (*Structure*) – Pymatgen Structure object. ## maml.describers._spectrum module @@ -1324,17 +1146,13 @@ Reference: @article{rupp2012fast, > title={Fast and accurate modeling of molecular - > ```none > atomization energies with machine learning}, > ``` - > author={Rupp, Matthias and Tkatchenko, Alexandre and M{“u}ller, - > ```none > Klaus-Robert and Von Lilienfeld, O Anatole}, > ``` - > journal={Physical review letters}, volume={108}, > number={5}, pages={058301}, > year={2012}, publisher={APS}} @@ -1347,9 +1165,8 @@ Reference: #### transform_one(mol: Molecule) - * **Parameters** -**mol** (*Molecule*) – pymatgen molecule. + **mol** (*Molecule*) – pymatgen molecule. Returns: np.ndarray the eigen value vectors of Coulob matrix @@ -1363,33 +1180,26 @@ Reference: @article{rupp2012fast, > title={Fast and accurate modeling of molecular - > ```none > atomization energies with machine learning}, > ``` - > author={Rupp, Matthias and Tkatchenko, Alexandre and M{“u}ller, - > ```none > Klaus-Robert and Von Lilienfeld, O Anatole}, > ``` - > journal={Physical review letters}, volume={108}, > number={5}, pages={058301}, > year={2012}, publisher={APS}} #### *abc_impl(* = <_abc.*abc_data object* ) -#### *static* _get_columb_mat(s: Molecule | Structure) - +#### *static* \_get_columb_mat(s: Molecule | Structure) * **Parameters** -**s** (*Molecule/Structure*) – input Molecule or Structure. Structure -is not advised since the feature will depend on the supercell size. - - + **s** (*Molecule/Structure*) – input Molecule or Structure. Structure + is not advised since the feature will depend on the supercell size. * **Returns** -Coulomb matrix of the structure + Coulomb matrix of the structure #### *sklearn_auto_wrap_output_keys(* = {‘transform’_ ) @@ -1397,27 +1207,21 @@ Coulomb matrix of the structure #### get_coulomb_mat(s: Molecule | Structure) - * **Parameters** -**s** (*Molecule/Structure*) – input Molecule or Structure. Structure -is not advised since the feature will depend on the supercell size - - + **s** (*Molecule/Structure*) – input Molecule or Structure. Structure + is not advised since the feature will depend on the supercell size * **Returns** -Coulomb matrix of the structure. + Coulomb matrix of the structure. #### transform_one(s: Molecule | Structure) - * **Parameters** -**s** (*Molecule/Structure*) – pymatgen Molecule or Structure, Structure is not -advised since the features will depend on supercell size. - - + **s** (*Molecule/Structure*) – pymatgen Molecule or Structure, Structure is not + advised since the features will depend on supercell size. * **Returns** -pandas.DataFrame. -The column is index of the structure, which is 0 for single input -df[0] returns the serials of coulomb_mat raval + pandas.DataFrame. + The column is index of the structure, which is 0 for single input + df[0] returns the serials of coulomb_mat raval ### *class* maml.describers._structure.DistinctSiteProperty(properties: list[str], symprec: float = 0.1, wyckoffs: list[str] | None = None, feature_batch: str = ‘pandas_concat’, \*\*kwargs) @@ -1432,9 +1236,7 @@ Reference: > title={Deep neural networks for accurate predictions of crystal stability}, > author={Ye, Weike and Chen, Chi and Wang, Zhenbin and - > > Chu, Iek-Heng and Ong, Shyue Ping}, - > journal={Nature communications}, > volume={9}, > number={1}, @@ -1452,13 +1254,10 @@ Reference: #### transform_one(structure: Structure) - * **Parameters** -**structure** (*pymatgen Structure*) – pymatgen structure for descriptor computation. - - + **structure** (*pymatgen Structure*) – pymatgen structure for descriptor computation. * **Returns** -pd.DataFrame that contains the distinct position labeled features + pd.DataFrame that contains the distinct position labeled features ### *class* maml.describers._structure.RandomizedCoulombMatrix(random_seed: int | None = None, is_ravel: bool = True, \*\*kwargs) @@ -1470,19 +1269,15 @@ Reference: @article{montavon2013machine, > title={Machine learning of molecular electronic properties - > ```none > in chemical compound space}, > ``` - > author={Montavon, Gr{‘e}goire and Rupp, Matthias and Gobre, - > ```none > Vivekanand and Vazquez-Mayagoitia, Alvaro and Hansen, Katja > and Tkatchenko, Alexandre and M{"u}ller, Klaus-Robert and > Von Lilienfeld, O Anatole}, > ``` - > journal={New Journal of Physics}, > volume={15}, number={9},pages={095003}, > year={2013},publisher={IOP Publishing}} @@ -1501,20 +1296,14 @@ Returns the randomized matrix (iii) draw a zero-mean unit-variance noise vector ε of the same > size as row_norms. - - 1. permute the rows and columns of C with the same permutation > that sorts row_norms + ε. - - * **Parameters** -**s** (*Molecule/Structure*) – pymatgen Molecule or Structure, Structure is not -advised since the features will depend on supercell size - - + **s** (*Molecule/Structure*) – pymatgen Molecule or Structure, Structure is not + advised since the features will depend on supercell size * **Returns** -pd.DataFrame randomized Coulomb matrix + pd.DataFrame randomized Coulomb matrix #### transform_one(s: Molecule | Structure) @@ -1535,19 +1324,15 @@ Reference: @inproceedings{montavon2012learning, > title={Learning invariant representations - > ```none > of molecules for atomization energy prediction}, > ``` - > author={Montavon, Gr{‘e}goire and Hansen, Katja - > ```none > and Fazli, Siamac and Rupp, Matthias and Biegler, > Franziska and Ziehe, Andreas and Tkatchenko, Alexandre > and Lilienfeld, Anatole V and M{"u}ller, Klaus-Robert}, > ``` - > booktitle={Advances in neural information processing systems}, > pages={440–448}, year={2012}} @@ -1561,14 +1346,11 @@ Reference: Returns the matrix sorted by the row norm. - * **Parameters** -**s** (*Molecule/Structure*) – pymatgen Molecule or Structure, Structure is not -advised since the features will depend on supercell size - - + **s** (*Molecule/Structure*) – pymatgen Molecule or Structure, Structure is not + advised since the features will depend on supercell size * **Returns** -pd.DataFrame, sorted Coulomb matrix + pd.DataFrame, sorted Coulomb matrix #### transform_one(s: Molecule | Structure) diff --git a/docs/maml.md b/docs/maml.md index 2d20b086..5c23d86f 100644 --- a/docs/maml.md +++ b/docs/maml.md @@ -8,3011 +8,1006 @@ nav_order: 5 ## Subpackages - * [maml.apps package](maml.apps.md) - - - * Subpackages - - - * [maml.apps.bowsr package](maml.apps.bowsr.md) - - - * Subpackages - - - * [maml.apps.bowsr.model package](maml.apps.bowsr.model.md) - - - * `EnergyModel` - - - * maml.apps.bowsr.model.base module - - - * maml.apps.bowsr.model.cgcnn module - - - * maml.apps.bowsr.model.dft module - - - * maml.apps.bowsr.model.megnet module - - - * maml.apps.bowsr.acquisition module - - - * `AcquisitionFunction` - - - * `AcquisitionFunction._ei()` - - - * `AcquisitionFunction._gpucb()` - - - * `AcquisitionFunction._poi()` - - - * `AcquisitionFunction._ucb()` - - - * `AcquisitionFunction.calculate()` - - - * `_trunc()` - - - * `ensure_rng()` - - - * `lhs_sample()` - - - * `predict_mean_std()` - - - * `propose_query_point()` - - - * maml.apps.bowsr.optimizer module - - - * `BayesianOptimizer` - - - * `BayesianOptimizer.add_query()` - - - * `BayesianOptimizer.as_dict()` - - - * `BayesianOptimizer.from_dict()` - - - * `BayesianOptimizer.get_derived_structure()` - - - * `BayesianOptimizer.get_formation_energy()` - - - * `BayesianOptimizer.get_optimized_structure_and_energy()` - - - * `BayesianOptimizer.gpr` - - - * `BayesianOptimizer.optimize()` - - - * `BayesianOptimizer.propose()` - - - * `BayesianOptimizer.set_bounds()` - - - * `BayesianOptimizer.set_gpr_params()` - - - * `BayesianOptimizer.set_space_empty()` - - - * `BayesianOptimizer.space` - - - * `atoms_crowded()` - - - * `struct2perturbation()` - - - * maml.apps.bowsr.perturbation module - - - * `LatticePerturbation` - - - * `LatticePerturbation.abc` - - - * `LatticePerturbation.fit_lattice` - - - * `LatticePerturbation.lattice` - - - * `LatticePerturbation.sanity_check()` - - - * `WyckoffPerturbation` - - - * `WyckoffPerturbation.fit_site` - - - * `WyckoffPerturbation.get_orbit()` - - - * `WyckoffPerturbation.sanity_check()` - - - * `WyckoffPerturbation.site` - - - * `WyckoffPerturbation.standardize()` - - - * `crystal_system()` - - - * `get_standardized_structure()` - - - * `perturbation_mapping()` - - - * maml.apps.bowsr.preprocessing module - - - * `DummyScaler` - - - * `DummyScaler.as_dict()` - - - * `DummyScaler.fit()` - - - * `DummyScaler.from_dict()` - - - * `DummyScaler.inverse_transform()` - - - * `DummyScaler.transform()` - - - * `StandardScaler` - - - * `StandardScaler.as_dict()` - - - * `StandardScaler.fit()` - - - * `StandardScaler.from_dict()` - - - * `StandardScaler.inverse_transform()` - - - * `StandardScaler.transform()` - - - * maml.apps.bowsr.target_space module - - - * `TargetSpace` - - - * `TargetSpace.bounds` - - - * `TargetSpace.lhs_sample()` - - - * `TargetSpace.params` - - - * `TargetSpace.probe()` - - - * `TargetSpace.register()` - - - * `TargetSpace.set_bounds()` - - - * `TargetSpace.set_empty()` - - - * `TargetSpace.target` - - - * `TargetSpace.uniform_sample()` - - - * `_hashable()` - - - * [maml.apps.gbe package](maml.apps.gbe.md) - - - * maml.apps.gbe.describer module - - - * `GBBond` - - - * `GBBond.NNDict` - - - * `GBBond._get_bond_mat()` - - - * `GBBond.as_dict()` - - - * `GBBond.bond_matrix` - - - * `GBBond.from_dict()` - - - * `GBBond.get_breakbond_ratio()` - - - * `GBBond.get_mean_bl_chg()` - - - * `GBBond.max_bl` - - - * `GBBond.min_bl` - - - * `GBDescriber` - - - * `GBDescriber._abc_impl` - - - * `GBDescriber._sklearn_auto_wrap_output_keys` - - - * `GBDescriber.generate_bulk_ref()` - - - * `GBDescriber.transform_one()` - - - * `convert_hcp_direction()` - - - * `convert_hcp_plane()` - - - * `get_elemental_feature()` - - - * `get_structural_feature()` - - - * maml.apps.gbe.presetfeatures module - - - * `my_quant` - - - * `my_quant.latex` - - - * `my_quant.name` - - - * `my_quant.unit` - - - * maml.apps.gbe.utils module - - - * `load_b0_dict()` - - - * `load_data()` - - - * `load_mean_delta_bl_dict()` - - - * `update_b0_dict()` - - - * [maml.apps.pes package](maml.apps.pes.md) - - - * `DefectFormation` - - - * `DefectFormation._parse()` - - - * `DefectFormation._sanity_check()` - - - * `DefectFormation._setup()` - - - * `DefectFormation.calculate()` - - - * `DefectFormation.get_unit_cell()` - - - * `ElasticConstant` - - - * `ElasticConstant._RESTART_CONFIG` - - - * `ElasticConstant._parse()` - - - * `ElasticConstant._sanity_check()` - - - * `ElasticConstant._setup()` - - - * `EnergyForceStress` - - - * `EnergyForceStress._parse()` - - - * `EnergyForceStress._rotate_force_stress()` - - - * `EnergyForceStress._sanity_check()` - - - * `EnergyForceStress._setup()` - - - * `EnergyForceStress.calculate()` - - - * `GAPotential` - - - * `GAPotential._abc_impl` - - - * `GAPotential._line_up()` - - - * `GAPotential.evaluate()` - - - * `GAPotential.from_config()` - - - * `GAPotential.pair_coeff` - - - * `GAPotential.pair_style` - - - * `GAPotential.read_cfgs()` - - - * `GAPotential.save()` - - - * `GAPotential.train()` - - - * `GAPotential.write_cfgs()` - - - * `GAPotential.write_param()` - - - * `LMPStaticCalculator` - - - * `LMPStaticCalculator._COMMON_CMDS` - - - * `LMPStaticCalculator._parse()` - - - * `LMPStaticCalculator._sanity_check()` - - - * `LMPStaticCalculator._setup()` - - - * `LMPStaticCalculator.allowed_kwargs` - - - * `LMPStaticCalculator.calculate()` - - - * `LMPStaticCalculator.set_lmp_exe()` - - - * `LatticeConstant` - - - * `LatticeConstant.calculate()` - - - * `MTPotential` - - - * `MTPotential._abc_impl` - - - * `MTPotential._line_up()` - - - * `MTPotential.evaluate()` - - - * `MTPotential.from_config()` - - - * `MTPotential.pair_coeff` - - - * `MTPotential.pair_style` - - - * `MTPotential.read_cfgs()` - - - * `MTPotential.train()` - - - * `MTPotential.write_cfg()` - - - * `MTPotential.write_ini()` - - - * `MTPotential.write_param()` - - - * `NNPotential` - - - * `NNPotential._abc_impl` - - - * `NNPotential._line_up()` - - - * `NNPotential.bohr_to_angstrom` - - - * `NNPotential.eV_to_Ha` - - - * `NNPotential.evaluate()` - - - * `NNPotential.from_config()` - - - * `NNPotential.load_input()` - - - * `NNPotential.load_scaler()` - - - * `NNPotential.load_weights()` - - - * `NNPotential.pair_coeff` - - - * `NNPotential.pair_style` - - - * `NNPotential.read_cfgs()` - - - * `NNPotential.train()` - - - * `NNPotential.write_cfgs()` - - - * `NNPotential.write_input()` - - - * `NNPotential.write_param()` - - - * `NudgedElasticBand` - - - * `NudgedElasticBand._parse()` - - - * `NudgedElasticBand._sanity_check()` - - - * `NudgedElasticBand._setup()` - - - * `NudgedElasticBand.calculate()` - - - * `NudgedElasticBand.get_unit_cell()` - - - * `Potential` - - - * `SNAPotential` - - - * `SNAPotential._abc_impl` - - - * `SNAPotential.evaluate()` - - - * `SNAPotential.from_config()` - - - * `SNAPotential.pair_coeff` - - - * `SNAPotential.pair_style` - - - * `SNAPotential.train()` - - - * `SNAPotential.write_param()` - - - * `SpectralNeighborAnalysis` - - - * `SpectralNeighborAnalysis._CMDS` - - - * `SpectralNeighborAnalysis._parse()` - - - * `SpectralNeighborAnalysis._sanity_check()` - - - * `SpectralNeighborAnalysis._setup()` - - - * `SpectralNeighborAnalysis.get_bs_subscripts()` - - - * `SpectralNeighborAnalysis.n_bs` - - - * `get_default_lmp_exe()` - - - * maml.apps.pes._base module - - - * `Potential` - - - * `PotentialMixin` - - - * `PotentialMixin.evaluate()` - - - * `PotentialMixin.from_config()` - - - * `PotentialMixin.predict_efs()` - - - * `PotentialMixin.train()` - - - * `PotentialMixin.write_param()` - - - * maml.apps.pes._gap module - - - * `GAPotential` - - - * `GAPotential._abc_impl` - - - * `GAPotential._line_up()` - - - * `GAPotential.evaluate()` - - - * `GAPotential.from_config()` - - - * `GAPotential.pair_coeff` - - - * `GAPotential.pair_style` - - - * `GAPotential.read_cfgs()` - - - * `GAPotential.save()` - - - * `GAPotential.train()` - - - * `GAPotential.write_cfgs()` - - - * `GAPotential.write_param()` - - - * maml.apps.pes._lammps module - - - * `DefectFormation` - - - * `DefectFormation._parse()` - - - * `DefectFormation._sanity_check()` - - - * `DefectFormation._setup()` - - - * `DefectFormation.calculate()` - - - * `DefectFormation.get_unit_cell()` - - - * `ElasticConstant` - - - * `ElasticConstant._RESTART_CONFIG` - - - * `ElasticConstant._parse()` - - - * `ElasticConstant._sanity_check()` - - - * `ElasticConstant._setup()` - - - * `EnergyForceStress` - - - * `EnergyForceStress._parse()` - - - * `EnergyForceStress._rotate_force_stress()` - - - * `EnergyForceStress._sanity_check()` - - - * `EnergyForceStress._setup()` - - - * `EnergyForceStress.calculate()` - - - * `LMPRelaxationCalculator` - - - * `LMPRelaxationCalculator._parse()` - - - * `LMPRelaxationCalculator._sanity_check()` - - - * `LMPRelaxationCalculator._setup()` - - - * `LMPStaticCalculator` - - - * `LMPStaticCalculator._COMMON_CMDS` - - - * `LMPStaticCalculator._parse()` - - - * `LMPStaticCalculator._sanity_check()` - - - * `LMPStaticCalculator._setup()` - - - * `LMPStaticCalculator.allowed_kwargs` - - - * `LMPStaticCalculator.calculate()` - - - * `LMPStaticCalculator.set_lmp_exe()` - - - * `LammpsPotential` - - - * `LammpsPotential._abc_impl` - - - * `LammpsPotential.predict_efs()` - - - * `LatticeConstant` - - - * `LatticeConstant.calculate()` - - - * `NudgedElasticBand` - - - * `NudgedElasticBand._parse()` - - - * `NudgedElasticBand._sanity_check()` - - - * `NudgedElasticBand._setup()` - - - * `NudgedElasticBand.calculate()` - - - * `NudgedElasticBand.get_unit_cell()` - - - * `SpectralNeighborAnalysis` - - - * `SpectralNeighborAnalysis._CMDS` - - - * `SpectralNeighborAnalysis._parse()` - - - * `SpectralNeighborAnalysis._sanity_check()` - - - * `SpectralNeighborAnalysis._setup()` - - - * `SpectralNeighborAnalysis.get_bs_subscripts()` - - - * `SpectralNeighborAnalysis.n_bs` - - - * `SurfaceEnergy` - - - * `SurfaceEnergy.calculate()` - - - * `_pretty_input()` - - - * `_read_dump()` - - - * `get_default_lmp_exe()` - - - * maml.apps.pes._mtp module - - - * `MTPotential` - - - * `MTPotential._abc_impl` - - - * `MTPotential._line_up()` - - - * `MTPotential.evaluate()` - - - * `MTPotential.from_config()` - - - * `MTPotential.pair_coeff` - - - * `MTPotential.pair_style` - - - * `MTPotential.read_cfgs()` - - - * `MTPotential.train()` - - - * `MTPotential.write_cfg()` - - - * `MTPotential.write_ini()` - - - * `MTPotential.write_param()` - - - * `feed()` - - - * maml.apps.pes._nnp module - - - * `NNPotential` - - - * `NNPotential._abc_impl` - - - * `NNPotential._line_up()` - - - * `NNPotential.bohr_to_angstrom` - - - * `NNPotential.eV_to_Ha` - - - * `NNPotential.evaluate()` - - - * `NNPotential.from_config()` - - - * `NNPotential.load_input()` - - - * `NNPotential.load_scaler()` - - - * `NNPotential.load_weights()` - - - * `NNPotential.pair_coeff` - - - * `NNPotential.pair_style` - - - * `NNPotential.read_cfgs()` - - - * `NNPotential.train()` - - - * `NNPotential.write_cfgs()` - - - * `NNPotential.write_input()` - - - * `NNPotential.write_param()` - - - * maml.apps.pes._snap module - - - * `SNAPotential` - - - * `SNAPotential._abc_impl` - - - * `SNAPotential.evaluate()` - - - * `SNAPotential.from_config()` - - - * `SNAPotential.pair_coeff` - - - * `SNAPotential.pair_style` - - - * `SNAPotential.train()` - - - * `SNAPotential.write_param()` - - - * [maml.apps.symbolic package](maml.apps.symbolic.md) - - - * `AdaptiveLasso` - - - * `AdaptiveLasso._penalty_jac()` - - - * `AdaptiveLasso.get_w()` - - - * `AdaptiveLasso.penalty()` - - - * `AdaptiveLasso.select()` - - - * `DantzigSelector` - - - * `DantzigSelector.construct_constraints()` - - - * `DantzigSelector.construct_jac()` - - - * `DantzigSelector.construct_loss()` - - - * `FeatureGenerator` - - - * `FeatureGenerator.augment()` - - - * `ISIS` - - - * `ISIS.evaluate()` - - - * `ISIS.run()` - - - * `L0BrutalForce` - - - * `L0BrutalForce.select()` - - - * `Lasso` - - - * `Lasso._penalty_jac()` - - - * `Lasso.penalty()` - - - * `Operator` - - - * `Operator.compute()` - - - * `Operator.from_str()` - - - * `Operator.gen_name()` - - - * `Operator.is_binary` - - - * `Operator.is_commutative` - - - * `Operator.is_unary` - - - * `Operator.support_op_rep` - - - * `SCAD` - - - * `SCAD._penalty_jac()` - - - * `SCAD.penalty()` - - - * `SIS` - - - * `SIS.compute_residual()` - - - * `SIS.run()` - - - * `SIS.screen()` - - - * `SIS.select()` - - - * `SIS.set_gamma()` - - - * `SIS.set_selector()` - - - * `SIS.update_gamma()` - - - * maml.apps.symbolic._feature_generator module - - - * `FeatureGenerator` - - - * `FeatureGenerator.augment()` - - - * `Operator` - - - * `Operator.compute()` - - - * `Operator.from_str()` - - - * `Operator.gen_name()` - - - * `Operator.is_binary` - - - * `Operator.is_commutative` - - - * `Operator.is_unary` - - - * `Operator.support_op_rep` - - - * `_my_abs_diff()` - - - * `_my_abs_log10()` - - - * `_my_abs_sqrt()` - - - * `_my_abs_sum()` - - - * `_my_diff()` - - - * `_my_div()` - - - * `_my_exp()` - - - * `_my_exp_power_2()` - - - * `_my_exp_power_3()` - - - * `_my_mul()` - - - * `_my_power()` - - - * `_my_sum()` - - - * `_my_sum_exp()` - - - * `_my_sum_power_2()` - - - * `_my_sum_power_3()` - - - * `_update_df()` - - - * `generate_feature()` - - - * maml.apps.symbolic._selectors module - - - * `AdaptiveLasso` - - - * `AdaptiveLasso._penalty_jac()` - - - * `AdaptiveLasso.get_w()` - - - * `AdaptiveLasso.penalty()` - - - * `AdaptiveLasso.select()` - - - * `BaseSelector` - - - * `BaseSelector._get_param_names()` - - - * `BaseSelector.compute_residual()` - - - * `BaseSelector.construct_constraints()` - - - * `BaseSelector.construct_jac()` - - - * `BaseSelector.construct_loss()` - - - * `BaseSelector.evaluate()` - - - * `BaseSelector.get_coef()` - - - * `BaseSelector.get_feature_indices()` - - - * `BaseSelector.get_params()` - - - * `BaseSelector.predict()` - - - * `BaseSelector.select()` - - - * `BaseSelector.set_params()` - - - * `DantzigSelector` - - - * `DantzigSelector.construct_constraints()` - - - * `DantzigSelector.construct_jac()` - - - * `DantzigSelector.construct_loss()` - - - * `L0BrutalForce` - - - * `L0BrutalForce.select()` - - - * `Lasso` - - - * `Lasso._penalty_jac()` - - - * `Lasso.penalty()` - - - * `PenalizedLeastSquares` - - - * `PenalizedLeastSquares._penalty_jac()` - - - * `PenalizedLeastSquares._sse_jac()` - - - * `PenalizedLeastSquares.construct_constraints()` - - - * `PenalizedLeastSquares.construct_jac()` - - - * `PenalizedLeastSquares.construct_loss()` - - - * `PenalizedLeastSquares.penalty()` - - - * `SCAD` - - - * `SCAD._penalty_jac()` - - - * `SCAD.penalty()` - - - * maml.apps.symbolic._selectors_cvxpy module - - - * `AdaptiveLassoCP` - - - * `AdaptiveLassoCP.get_w()` - - - * `AdaptiveLassoCP.penalty()` - - - * `AdaptiveLassoCP.select()` - - - * `BaseSelectorCP` - - - * `BaseSelectorCP.construct_constraints()` - - - * `BaseSelectorCP.construct_loss()` - - - * `BaseSelectorCP.select()` - - - * `DantzigSelectorCP` - - - * `DantzigSelectorCP.construct_constraints()` - - - * `DantzigSelectorCP.construct_loss()` - - - * `LassoCP` - - - * `LassoCP.penalty()` - - - * `PenalizedLeastSquaresCP` - - - * `PenalizedLeastSquaresCP.construct_loss()` - - - * `PenalizedLeastSquaresCP.penalty()` - - - * maml.apps.symbolic._sis module - - - * `ISIS` - - - * `ISIS.evaluate()` - - - * `ISIS.run()` - - - * `SIS` - - - * `SIS.compute_residual()` - - - * `SIS.run()` - - - * `SIS.screen()` - - - * `SIS.select()` - - - * `SIS.set_gamma()` - - - * `SIS.set_selector()` - - - * `SIS.update_gamma()` - - - * `_best_combination()` - - - * `_eval()` - - - * `_get_coeff()` - - -* [maml.base package](maml.base.md) - - - * `BaseDataSource` - - - * `BaseDataSource.get()` - - - * `BaseDescriber` - - - * `BaseDescriber._abc_impl` - - - * `BaseDescriber._is_multi_output()` - - - * `BaseDescriber._sklearn_auto_wrap_output_keys` - - - * `BaseDescriber.clear_cache()` - - - * `BaseDescriber.feature_dim` - - - * `BaseDescriber.fit()` - - - * `BaseDescriber.transform()` - - - * `BaseDescriber.transform_one()` - - - * `BaseModel` - - - * `BaseModel._predict()` - - - * `BaseModel.fit()` - - - * `BaseModel.predict_objs()` - - - * `BaseModel.train()` - - - * `DummyDescriber` - - - * `DummyDescriber._abc_impl` - - - * `DummyDescriber._sklearn_auto_wrap_output_keys` - - - * `DummyDescriber.transform_one()` - - - * `KerasModel` - - - * `KerasModel._get_validation_data()` - - - * `KerasModel.fit()` - - - * `SKLModel` - - - * `SequentialDescriber` - - - * `SequentialDescriber._abc_impl` - - - * `SequentialDescriber.steps` - - - * `TargetScalerMixin` - - - * `TargetScalerMixin.predict_objs()` - - - * `TargetScalerMixin.train()` - - - * `describer_type()` - - - * `get_feature_batch()` - - - * `is_keras_model()` - - - * `is_sklearn_model()` - - - * maml.base._data module - - - * `BaseDataSource` - - - * `BaseDataSource.get()` - - - * maml.base._describer module - - - * `BaseDescriber` - - - * `BaseDescriber._abc_impl` - - - * `BaseDescriber._is_multi_output()` - - - * `BaseDescriber._sklearn_auto_wrap_output_keys` - - - * `BaseDescriber.clear_cache()` - - - * `BaseDescriber.feature_dim` - - - * `BaseDescriber.fit()` - - - * `BaseDescriber.transform()` - - - * `BaseDescriber.transform_one()` - - - * `DummyDescriber` - - - * `DummyDescriber._abc_impl` - - - * `DummyDescriber._sklearn_auto_wrap_output_keys` - - - * `DummyDescriber.transform_one()` - - - * `SequentialDescriber` - - - * `SequentialDescriber._abc_impl` - - - * `SequentialDescriber.steps` - - - * `_transform_one()` - - - * `describer_type()` - - - * maml.base._feature_batch module - - - * `get_feature_batch()` - - - * `no_action()` - - - * `pandas_concat()` - - - * `stack_first_dim()` - - - * `stack_padded()` - - - * maml.base._mixin module - - - * `TargetScalerMixin` - - - * `TargetScalerMixin.predict_objs()` - - - * `TargetScalerMixin.train()` - - - * maml.base._model module - - - * `BaseModel` - - - * `BaseModel._predict()` - - - * `BaseModel.fit()` - - - * `BaseModel.predict_objs()` - - - * `BaseModel.train()` - - - * `KerasMixin` - - - * `KerasMixin.evaluate()` - - - * `KerasMixin.from_file()` - - - * `KerasMixin.get_input_dim()` - - - * `KerasMixin.load()` - - - * `KerasMixin.save()` - - - * `KerasModel` - - - * `KerasModel._get_validation_data()` - - - * `KerasModel.fit()` - - - * `SKLModel` - - - * `SklearnMixin` - - - * `SklearnMixin.evaluate()` - - - * `SklearnMixin.from_file()` - - - * `SklearnMixin.load()` - - - * `SklearnMixin.save()` - - - * `is_keras_model()` - - - * `is_sklearn_model()` - - -* [maml.data package](maml.data.md) - - - * `MaterialsProject` - - - * `MaterialsProject.get()` - - - * `URLSource` - - - * `URLSource.get()` - - - * maml.data._mp module - - - * `MaterialsProject` - - - * `MaterialsProject.get()` - - - * maml.data._url module - - - * `FigshareSource` - - - * `FigshareSource.get()` - - - * `URLSource` - - - * `URLSource.get()` - - -* [maml.describers package](maml.describers.md) - - - * `BPSymmetryFunctions` - - - * `BPSymmetryFunctions._abc_impl` - - - * `BPSymmetryFunctions._fc()` - - - * `BPSymmetryFunctions._sklearn_auto_wrap_output_keys` - - - * `BPSymmetryFunctions.describer_type` - - - * `BPSymmetryFunctions.transform_one()` - - - * `BispectrumCoefficients` - - - * `BispectrumCoefficients._abc_impl` - - - * `BispectrumCoefficients._sklearn_auto_wrap_output_keys` - - - * `BispectrumCoefficients.describer_type` - - - * `BispectrumCoefficients.feature_dim` - - - * `BispectrumCoefficients.subscripts` - - - * `BispectrumCoefficients.transform_one()` - - - * `CoulombEigenSpectrum` - - - * `CoulombEigenSpectrum._abc_impl` - - - * `CoulombEigenSpectrum._sklearn_auto_wrap_output_keys` - - - * `CoulombEigenSpectrum.describer_type` - - - * `CoulombEigenSpectrum.transform_one()` - - - * `CoulombMatrix` - - - * `CoulombMatrix._abc_impl` - - - * `CoulombMatrix._get_columb_mat()` - - - * `CoulombMatrix._sklearn_auto_wrap_output_keys` - - - * `CoulombMatrix.describer_type` - - - * `CoulombMatrix.get_coulomb_mat()` - - - * `CoulombMatrix.transform_one()` - - - * `DistinctSiteProperty` - - - * `DistinctSiteProperty._abc_impl` - - - * `DistinctSiteProperty._sklearn_auto_wrap_output_keys` - - - * `DistinctSiteProperty.describer_type` - - - * `DistinctSiteProperty.supported_properties` - - - * `DistinctSiteProperty.transform_one()` - - - * `ElementProperty` - - - * `ElementProperty._abc_impl` - - - * `ElementProperty._get_param_names()` - - - * `ElementProperty._sklearn_auto_wrap_output_keys` - - - * `ElementProperty.describer_type` - - - * `ElementProperty.from_preset()` - - - * `ElementProperty.get_params()` - - - * `ElementProperty.transform_one()` - - - * `ElementStats` - - - * `ElementStats.ALLOWED_STATS` - - - * `ElementStats.AVAILABLE_DATA` - - - * `ElementStats._abc_impl` - - - * `ElementStats._reduce_dimension()` - - - * `ElementStats._sklearn_auto_wrap_output_keys` - - - * `ElementStats.describer_type` - - - * `ElementStats.from_data()` - - - * `ElementStats.from_file()` - - - * `ElementStats.transform_one()` - - - * `M3GNetStructure` - - - * `M3GNetStructure._abc_impl` - - - * `M3GNetStructure._sklearn_auto_wrap_output_keys` - - - * `M3GNetStructure.transform_one()` - - - * `MEGNetSite` - - - * `MEGNetSite._abc_impl` - - - * `MEGNetSite._sklearn_auto_wrap_output_keys` - - - * `MEGNetSite.describer_type` - - - * `MEGNetSite.transform_one()` - - - * `MEGNetStructure` - - - * `MEGNetStructure._abc_impl` - - - * `MEGNetStructure._sklearn_auto_wrap_output_keys` - - - * `MEGNetStructure.describer_type` - - - * `MEGNetStructure.transform_one()` - - - * `RadialDistributionFunction` - - - * `RadialDistributionFunction._get_specie_density()` - - - * `RadialDistributionFunction.get_site_coordination()` - - - * `RadialDistributionFunction.get_site_rdf()` - - - * `RadialDistributionFunction.get_species_coordination()` - - - * `RadialDistributionFunction.get_species_rdf()` - - - * `RandomizedCoulombMatrix` - - - * `RandomizedCoulombMatrix._abc_impl` - - - * `RandomizedCoulombMatrix._sklearn_auto_wrap_output_keys` - - - * `RandomizedCoulombMatrix.describer_type` - - - * `RandomizedCoulombMatrix.get_randomized_coulomb_mat()` - - - * `RandomizedCoulombMatrix.transform_one()` - - - * `SiteElementProperty` - - - * `SiteElementProperty._abc_impl` - - - * `SiteElementProperty._get_keys()` - - - * `SiteElementProperty._sklearn_auto_wrap_output_keys` - - - * `SiteElementProperty.describer_type` - - - * `SiteElementProperty.feature_dim` - - - * `SiteElementProperty.transform_one()` - - - * `SmoothOverlapAtomicPosition` - - - * `SmoothOverlapAtomicPosition._abc_impl` - - - * `SmoothOverlapAtomicPosition._sklearn_auto_wrap_output_keys` - - - * `SmoothOverlapAtomicPosition.describer_type` - - - * `SmoothOverlapAtomicPosition.transform_one()` - - - * `SortedCoulombMatrix` - - - * `SortedCoulombMatrix._abc_impl` - - - * `SortedCoulombMatrix._sklearn_auto_wrap_output_keys` - - - * `SortedCoulombMatrix.describer_type` - - - * `SortedCoulombMatrix.get_sorted_coulomb_mat()` - - - * `SortedCoulombMatrix.transform_one()` - - - * `wrap_matminer_describer()` - - - * maml.describers._composition module - - - * `ElementStats` - - - * `ElementStats.ALLOWED_STATS` - - - * `ElementStats.AVAILABLE_DATA` - - - * `ElementStats._abc_impl` - - - * `ElementStats._reduce_dimension()` - - - * `ElementStats._sklearn_auto_wrap_output_keys` - - - * `ElementStats.describer_type` - - - * `ElementStats.from_data()` - - - * `ElementStats.from_file()` - - - * `ElementStats.transform_one()` - - - * `_is_element_or_specie()` - - - * `_keys_are_elements()` - - - * maml.describers._m3gnet module - - - * `M3GNetStructure` - - - * `M3GNetStructure._abc_impl` - - - * `M3GNetStructure._sklearn_auto_wrap_output_keys` - - - * `M3GNetStructure.transform_one()` - - - * maml.describers._matminer module - - - * `wrap_matminer_describer()` - - - * maml.describers._megnet module - - - * `MEGNetNotFound` - - - * `MEGNetSite` - - - * `MEGNetSite._abc_impl` - - - * `MEGNetSite._sklearn_auto_wrap_output_keys` - - - * `MEGNetSite.describer_type` - - - * `MEGNetSite.transform_one()` - - - * `MEGNetStructure` - - - * `MEGNetStructure._abc_impl` - - - * `MEGNetStructure._sklearn_auto_wrap_output_keys` - - - * `MEGNetStructure.describer_type` - - - * `MEGNetStructure.transform_one()` - - - * `_load_model()` - - - * maml.describers._rdf module - - - * `RadialDistributionFunction` - - - * `RadialDistributionFunction._get_specie_density()` - - - * `RadialDistributionFunction.get_site_coordination()` - - - * `RadialDistributionFunction.get_site_rdf()` - - - * `RadialDistributionFunction.get_species_coordination()` - - - * `RadialDistributionFunction.get_species_rdf()` - - - * `_dist_to_counts()` - - - * `get_pair_distances()` - - - * maml.describers._site module - - - * `BPSymmetryFunctions` - - - * `BPSymmetryFunctions._abc_impl` - - - * `BPSymmetryFunctions._fc()` - - - * `BPSymmetryFunctions._sklearn_auto_wrap_output_keys` - - - * `BPSymmetryFunctions.describer_type` - - - * `BPSymmetryFunctions.transform_one()` - - - * `BispectrumCoefficients` - - - * `BispectrumCoefficients._abc_impl` - - - * `BispectrumCoefficients._sklearn_auto_wrap_output_keys` - - - * `BispectrumCoefficients.describer_type` - - - * `BispectrumCoefficients.feature_dim` - - - * `BispectrumCoefficients.subscripts` - - - * `BispectrumCoefficients.transform_one()` - - - * `MEGNetSite` - - - * `MEGNetSite._abc_impl` - - - * `MEGNetSite._sklearn_auto_wrap_output_keys` - - - * `MEGNetSite.describer_type` - - - * `MEGNetSite.transform_one()` - - - * `SiteElementProperty` - - - * `SiteElementProperty._abc_impl` - - - * `SiteElementProperty._get_keys()` - - - * `SiteElementProperty._sklearn_auto_wrap_output_keys` - - - * `SiteElementProperty.describer_type` - - - * `SiteElementProperty.feature_dim` - - - * `SiteElementProperty.transform_one()` - - - * `SmoothOverlapAtomicPosition` - - - * `SmoothOverlapAtomicPosition._abc_impl` - - - * `SmoothOverlapAtomicPosition._sklearn_auto_wrap_output_keys` - - - * `SmoothOverlapAtomicPosition.describer_type` - - - * `SmoothOverlapAtomicPosition.transform_one()` - - - * maml.describers._spectrum module - - - * maml.describers._structure module - - - * `CoulombEigenSpectrum` - - - * `CoulombEigenSpectrum._abc_impl` - - - * `CoulombEigenSpectrum._sklearn_auto_wrap_output_keys` - - - * `CoulombEigenSpectrum.describer_type` - - - * `CoulombEigenSpectrum.transform_one()` - - - * `CoulombMatrix` - - - * `CoulombMatrix._abc_impl` - - - * `CoulombMatrix._get_columb_mat()` - - - * `CoulombMatrix._sklearn_auto_wrap_output_keys` - - - * `CoulombMatrix.describer_type` - - - * `CoulombMatrix.get_coulomb_mat()` - - - * `CoulombMatrix.transform_one()` - - - * `DistinctSiteProperty` - - - * `DistinctSiteProperty._abc_impl` - - - * `DistinctSiteProperty._sklearn_auto_wrap_output_keys` - - - * `DistinctSiteProperty.describer_type` - - - * `DistinctSiteProperty.supported_properties` - - - * `DistinctSiteProperty.transform_one()` - - - * `RandomizedCoulombMatrix` - - - * `RandomizedCoulombMatrix._abc_impl` - - - * `RandomizedCoulombMatrix._sklearn_auto_wrap_output_keys` - - - * `RandomizedCoulombMatrix.describer_type` - - - * `RandomizedCoulombMatrix.get_randomized_coulomb_mat()` - - - * `RandomizedCoulombMatrix.transform_one()` - - - * `SortedCoulombMatrix` - - - * `SortedCoulombMatrix._abc_impl` - - - * `SortedCoulombMatrix._sklearn_auto_wrap_output_keys` - - - * `SortedCoulombMatrix.describer_type` - - - * `SortedCoulombMatrix.get_sorted_coulomb_mat()` - - - * `SortedCoulombMatrix.transform_one()` - - -* [maml.models package](maml.models.md) - - - * `AtomSets` - - - * `AtomSets._get_data_generator()` - - - * `AtomSets._predict()` - - - * `AtomSets.evaluate()` - - - * `AtomSets.fit()` - - - * `AtomSets.from_dir()` - - - * `AtomSets.save()` - - - * `KerasModel` - - - * `KerasModel._get_validation_data()` - - - * `KerasModel.fit()` - - - * `MLP` - - - * `SKLModel` - - - * `WeightedAverageLayer` - - - * `WeightedAverageLayer.build()` - - - * `WeightedAverageLayer.call()` - - - * `WeightedAverageLayer.compute_output_shape()` - - - * `WeightedAverageLayer.get_config()` - - - * `WeightedAverageLayer.reduce_sum()` - - - * `WeightedSet2Set` - - - * `WeightedSet2Set._lstm()` - - - * `WeightedSet2Set.build()` - - - * `WeightedSet2Set.call()` - - - * `WeightedSet2Set.compute_output_shape()` - - - * `WeightedSet2Set.get_config()` - - - * Subpackages - - - * [maml.models.dl package](maml.models.dl.md) - - - * `AtomSets` - - - * `AtomSets._get_data_generator()` - - - * `AtomSets._predict()` - - - * `AtomSets.evaluate()` - - - * `AtomSets.fit()` - - - * `AtomSets.from_dir()` - - - * `AtomSets.save()` - - - * `MLP` - - - * `WeightedAverageLayer` - - - * `WeightedAverageLayer.build()` - - - * `WeightedAverageLayer.call()` - - - * `WeightedAverageLayer.compute_output_shape()` - - - * `WeightedAverageLayer.get_config()` - - - * `WeightedAverageLayer.reduce_sum()` - - - * `WeightedSet2Set` - - - * `WeightedSet2Set._lstm()` - - - * `WeightedSet2Set.build()` - - - * `WeightedSet2Set.call()` - - - * `WeightedSet2Set.compute_output_shape()` - - - * `WeightedSet2Set.get_config()` - - - * maml.models.dl._atomsets module - - - * `AtomSets` - - - * `AtomSets._get_data_generator()` - - - * `AtomSets._predict()` - - - * `AtomSets.evaluate()` - - - * `AtomSets.fit()` - - - * `AtomSets.from_dir()` - - - * `AtomSets.save()` - - - * `construct_atom_sets()` - - - * maml.models.dl._keras_utils module - - - * `deserialize_keras_activation()` - - - * `deserialize_keras_optimizer()` - - - * maml.models.dl._layers module - - - * `WeightedAverageLayer` - - - * `WeightedAverageLayer.build()` - - - * `WeightedAverageLayer.call()` - - - * `WeightedAverageLayer.compute_output_shape()` - - - * `WeightedAverageLayer.get_config()` - - - * `WeightedAverageLayer.reduce_sum()` - - - * `WeightedSet2Set` - - - * `WeightedSet2Set._lstm()` - - - * `WeightedSet2Set.build()` - - - * `WeightedSet2Set.call()` - - - * `WeightedSet2Set.compute_output_shape()` - - - * `WeightedSet2Set.get_config()` - - - * maml.models.dl._mlp module - - - * `MLP` - - - * `construct_mlp()` - - -* [maml.sampling package](maml.sampling.md) - - - * maml.sampling.clustering module - - - * `BirchClustering` - - - * `BirchClustering._sklearn_auto_wrap_output_keys` - - - * `BirchClustering.fit()` - - - * `BirchClustering.transform()` - - - * maml.sampling.direct module - - - * maml.sampling.pca module - - - * `PrincipalComponentAnalysis` - - - * `PrincipalComponentAnalysis._sklearn_auto_wrap_output_keys` - - - * `PrincipalComponentAnalysis.fit()` - - - * `PrincipalComponentAnalysis.transform()` - - - * maml.sampling.stratified_sampling module - - - * `SelectKFromClusters` - - - * `SelectKFromClusters._sklearn_auto_wrap_output_keys` - - - * `SelectKFromClusters.fit()` - - - * `SelectKFromClusters.transform()` - - -* [maml.utils package](maml.utils.md) - - - * `ConstantValue` - - - * `ConstantValue.get_value()` - - - * `DataSplitter` - - - * `DataSplitter.split()` - - - * `DummyScaler` - - - * `DummyScaler.from_training_data()` - - - * `DummyScaler.inverse_transform()` - - - * `DummyScaler.transform()` - - - * `LinearProfile` - - - * `LinearProfile.get_value()` - - - * `MultiScratchDir` - - - * `MultiScratchDir.SCR_LINK` - - - * `Scaler` - - - * `Scaler.inverse_transform()` - - - * `Scaler.transform()` - - - * `ShuffleSplitter` - - - * `ShuffleSplitter.split()` - - - * `StandardScaler` - - - * `StandardScaler.from_training_data()` - - - * `StandardScaler.inverse_transform()` - - - * `StandardScaler.transform()` - - - * `Stats` - - - * `Stats.allowed_stats` - - - * `Stats.average()` - - - * `Stats.geometric_mean()` - - - * `Stats.harmonic_mean()` - - - * `Stats.inverse_mean()` - - - * `Stats.kurtosis()` - - - * `Stats.max()` - - - * `Stats.mean()` - - - * `Stats.mean_absolute_deviation()` - - - * `Stats.mean_absolute_error()` - - - * `Stats.min()` - - - * `Stats.mode()` - - - * `Stats.moment()` - - - * `Stats.power_mean()` - - - * `Stats.range()` - - - * `Stats.shifted_geometric_mean()` - - - * `Stats.skewness()` - - - * `Stats.std()` - - - * `ValueProfile` - - - * `ValueProfile.get_value()` - - - * `ValueProfile.get_value()` - - - * `ValueProfile.increment_step()` - - - * `check_structures_forces_stresses()` - - + * Subpackages + * [maml.apps.bowsr package](maml.apps.bowsr.md) + * Subpackages + * [maml.apps.bowsr.model package](maml.apps.bowsr.model.md) + * `EnergyModel` + * maml.apps.bowsr.model.base module + * maml.apps.bowsr.model.cgcnn module + * maml.apps.bowsr.model.dft module + * maml.apps.bowsr.model.megnet module + * maml.apps.bowsr.acquisition module + * `AcquisitionFunction` + * `AcquisitionFunction._ei()` + * `AcquisitionFunction._gpucb()` + * `AcquisitionFunction._poi()` + * `AcquisitionFunction._ucb()` + * `AcquisitionFunction.calculate()` + * `_trunc()` + * `ensure_rng()` + * `lhs_sample()` + * `predict_mean_std()` + * `propose_query_point()` + * maml.apps.bowsr.optimizer module + * `BayesianOptimizer` + * `BayesianOptimizer.add_query()` + * `BayesianOptimizer.as_dict()` + * `BayesianOptimizer.from_dict()` + * `BayesianOptimizer.get_derived_structure()` + * `BayesianOptimizer.get_formation_energy()` + * `BayesianOptimizer.get_optimized_structure_and_energy()` + * `BayesianOptimizer.gpr` + * `BayesianOptimizer.optimize()` + * `BayesianOptimizer.propose()` + * `BayesianOptimizer.set_bounds()` + * `BayesianOptimizer.set_gpr_params()` + * `BayesianOptimizer.set_space_empty()` + * `BayesianOptimizer.space` + * `atoms_crowded()` + * `struct2perturbation()` + * maml.apps.bowsr.perturbation module + * `LatticePerturbation` + * `LatticePerturbation.abc` + * `LatticePerturbation.fit_lattice` + * `LatticePerturbation.lattice` + * `LatticePerturbation.sanity_check()` + * `WyckoffPerturbation` + * `WyckoffPerturbation.fit_site` + * `WyckoffPerturbation.get_orbit()` + * `WyckoffPerturbation.sanity_check()` + * `WyckoffPerturbation.site` + * `WyckoffPerturbation.standardize()` + * `crystal_system()` + * `get_standardized_structure()` + * `perturbation_mapping()` + * maml.apps.bowsr.preprocessing module + * `DummyScaler` + * `DummyScaler.as_dict()` + * `DummyScaler.fit()` + * `DummyScaler.from_dict()` + * `DummyScaler.inverse_transform()` + * `DummyScaler.transform()` + * `StandardScaler` + * `StandardScaler.as_dict()` + * `StandardScaler.fit()` + * `StandardScaler.from_dict()` + * `StandardScaler.inverse_transform()` + * `StandardScaler.transform()` + * maml.apps.bowsr.target_space module + * `TargetSpace` + * `TargetSpace.bounds` + * `TargetSpace.lhs_sample()` + * `TargetSpace.params` + * `TargetSpace.probe()` + * `TargetSpace.register()` + * `TargetSpace.set_bounds()` + * `TargetSpace.set_empty()` + * `TargetSpace.target` + * `TargetSpace.uniform_sample()` + * `_hashable()` + * [maml.apps.gbe package](maml.apps.gbe.md) + * maml.apps.gbe.describer module + * `GBBond` + * `GBBond.NNDict` + * `GBBond._get_bond_mat()` + * `GBBond.as_dict()` + * `GBBond.bond_matrix` + * `GBBond.from_dict()` + * `GBBond.get_breakbond_ratio()` + * `GBBond.get_mean_bl_chg()` + * `GBBond.max_bl` + * `GBBond.min_bl` + * `GBDescriber` + * `GBDescriber._abc_impl` + * `GBDescriber._sklearn_auto_wrap_output_keys` + * `GBDescriber.generate_bulk_ref()` + * `GBDescriber.transform_one()` + * `convert_hcp_direction()` + * `convert_hcp_plane()` + * `get_elemental_feature()` + * `get_structural_feature()` + * maml.apps.gbe.presetfeatures module + * `my_quant` + * `my_quant.latex` + * `my_quant.name` + * `my_quant.unit` + * maml.apps.gbe.utils module + * `load_b0_dict()` + * `load_data()` + * `load_mean_delta_bl_dict()` + * `update_b0_dict()` + * [maml.apps.pes package](maml.apps.pes.md) + * `DefectFormation` + * `DefectFormation._parse()` + * `DefectFormation._sanity_check()` + * `DefectFormation._setup()` + * `DefectFormation.calculate()` + * `DefectFormation.get_unit_cell()` + * `ElasticConstant` + * `ElasticConstant._RESTART_CONFIG` + * `ElasticConstant._parse()` + * `ElasticConstant._sanity_check()` + * `ElasticConstant._setup()` + * `EnergyForceStress` + * `EnergyForceStress._parse()` + * `EnergyForceStress._rotate_force_stress()` + * `EnergyForceStress._sanity_check()` + * `EnergyForceStress._setup()` + * `EnergyForceStress.calculate()` + * `GAPotential` + * `GAPotential._abc_impl` + * `GAPotential._line_up()` + * `GAPotential.evaluate()` + * `GAPotential.from_config()` + * `GAPotential.pair_coeff` + * `GAPotential.pair_style` + * `GAPotential.read_cfgs()` + * `GAPotential.save()` + * `GAPotential.train()` + * `GAPotential.write_cfgs()` + * `GAPotential.write_param()` + * `LMPStaticCalculator` + * `LMPStaticCalculator._COMMON_CMDS` + * `LMPStaticCalculator._parse()` + * `LMPStaticCalculator._sanity_check()` + * `LMPStaticCalculator._setup()` + * `LMPStaticCalculator.allowed_kwargs` + * `LMPStaticCalculator.calculate()` + * `LMPStaticCalculator.set_lmp_exe()` + * `LatticeConstant` + * `LatticeConstant.calculate()` + * `MTPotential` + * `MTPotential._abc_impl` + * `MTPotential._line_up()` + * `MTPotential.evaluate()` + * `MTPotential.from_config()` + * `MTPotential.pair_coeff` + * `MTPotential.pair_style` + * `MTPotential.read_cfgs()` + * `MTPotential.train()` + * `MTPotential.write_cfg()` + * `MTPotential.write_ini()` + * `MTPotential.write_param()` + * `NNPotential` + * `NNPotential._abc_impl` + * `NNPotential._line_up()` + * `NNPotential.bohr_to_angstrom` + * `NNPotential.eV_to_Ha` + * `NNPotential.evaluate()` + * `NNPotential.from_config()` + * `NNPotential.load_input()` + * `NNPotential.load_scaler()` + * `NNPotential.load_weights()` + * `NNPotential.pair_coeff` + * `NNPotential.pair_style` + * `NNPotential.read_cfgs()` + * `NNPotential.train()` + * `NNPotential.write_cfgs()` + * `NNPotential.write_input()` + * `NNPotential.write_param()` + * `NudgedElasticBand` + * `NudgedElasticBand._parse()` + * `NudgedElasticBand._sanity_check()` + * `NudgedElasticBand._setup()` + * `NudgedElasticBand.calculate()` + * `NudgedElasticBand.get_unit_cell()` + * `Potential` + * `SNAPotential` + * `SNAPotential._abc_impl` + * `SNAPotential.evaluate()` + * `SNAPotential.from_config()` + * `SNAPotential.pair_coeff` + * `SNAPotential.pair_style` + * `SNAPotential.train()` + * `SNAPotential.write_param()` + * `SpectralNeighborAnalysis` + * `SpectralNeighborAnalysis._CMDS` + * `SpectralNeighborAnalysis._parse()` + * `SpectralNeighborAnalysis._sanity_check()` + * `SpectralNeighborAnalysis._setup()` + * `SpectralNeighborAnalysis.get_bs_subscripts()` + * `SpectralNeighborAnalysis.n_bs` + * `get_default_lmp_exe()` + * maml.apps.pes._base module + * `Potential` + * `PotentialMixin` + * `PotentialMixin.evaluate()` + * `PotentialMixin.from_config()` + * `PotentialMixin.predict_efs()` + * `PotentialMixin.train()` + * `PotentialMixin.write_param()` + * maml.apps.pes._gap module + * `GAPotential` + * `GAPotential._abc_impl` + * `GAPotential._line_up()` + * `GAPotential.evaluate()` + * `GAPotential.from_config()` + * `GAPotential.pair_coeff` + * `GAPotential.pair_style` + * `GAPotential.read_cfgs()` + * `GAPotential.save()` + * `GAPotential.train()` + * `GAPotential.write_cfgs()` + * `GAPotential.write_param()` + * maml.apps.pes._lammps module + * `DefectFormation` + * `DefectFormation._parse()` + * `DefectFormation._sanity_check()` + * `DefectFormation._setup()` + * `DefectFormation.calculate()` + * `DefectFormation.get_unit_cell()` + * `ElasticConstant` + * `ElasticConstant._RESTART_CONFIG` + * `ElasticConstant._parse()` + * `ElasticConstant._sanity_check()` + * `ElasticConstant._setup()` + * `EnergyForceStress` + * `EnergyForceStress._parse()` + * `EnergyForceStress._rotate_force_stress()` + * `EnergyForceStress._sanity_check()` + * `EnergyForceStress._setup()` + * `EnergyForceStress.calculate()` + * `LMPRelaxationCalculator` + * `LMPRelaxationCalculator._parse()` + * `LMPRelaxationCalculator._sanity_check()` + * `LMPRelaxationCalculator._setup()` + * `LMPStaticCalculator` + * `LMPStaticCalculator._COMMON_CMDS` + * `LMPStaticCalculator._parse()` + * `LMPStaticCalculator._sanity_check()` + * `LMPStaticCalculator._setup()` + * `LMPStaticCalculator.allowed_kwargs` + * `LMPStaticCalculator.calculate()` + * `LMPStaticCalculator.set_lmp_exe()` + * `LammpsPotential` + * `LammpsPotential._abc_impl` + * `LammpsPotential.predict_efs()` + * `LatticeConstant` + * `LatticeConstant.calculate()` + * `NudgedElasticBand` + * `NudgedElasticBand._parse()` + * `NudgedElasticBand._sanity_check()` + * `NudgedElasticBand._setup()` + * `NudgedElasticBand.calculate()` + * `NudgedElasticBand.get_unit_cell()` + * `SpectralNeighborAnalysis` + * `SpectralNeighborAnalysis._CMDS` + * `SpectralNeighborAnalysis._parse()` + * `SpectralNeighborAnalysis._sanity_check()` + * `SpectralNeighborAnalysis._setup()` + * `SpectralNeighborAnalysis.get_bs_subscripts()` + * `SpectralNeighborAnalysis.n_bs` + * `SurfaceEnergy` + * `SurfaceEnergy.calculate()` + * `_pretty_input()` + * `_read_dump()` + * `get_default_lmp_exe()` + * maml.apps.pes._mtp module + * `MTPotential` + * `MTPotential._abc_impl` + * `MTPotential._line_up()` + * `MTPotential.evaluate()` + * `MTPotential.from_config()` + * `MTPotential.pair_coeff` + * `MTPotential.pair_style` + * `MTPotential.read_cfgs()` + * `MTPotential.train()` + * `MTPotential.write_cfg()` + * `MTPotential.write_ini()` + * `MTPotential.write_param()` + * `feed()` + * maml.apps.pes._nnp module + * `NNPotential` + * `NNPotential._abc_impl` + * `NNPotential._line_up()` + * `NNPotential.bohr_to_angstrom` + * `NNPotential.eV_to_Ha` + * `NNPotential.evaluate()` + * `NNPotential.from_config()` + * `NNPotential.load_input()` + * `NNPotential.load_scaler()` + * `NNPotential.load_weights()` + * `NNPotential.pair_coeff` + * `NNPotential.pair_style` + * `NNPotential.read_cfgs()` + * `NNPotential.train()` + * `NNPotential.write_cfgs()` + * `NNPotential.write_input()` + * `NNPotential.write_param()` + * maml.apps.pes._snap module + * `SNAPotential` + * `SNAPotential._abc_impl` + * `SNAPotential.evaluate()` + * `SNAPotential.from_config()` + * `SNAPotential.pair_coeff` + * `SNAPotential.pair_style` + * `SNAPotential.train()` + * `SNAPotential.write_param()` + * [maml.apps.symbolic package](maml.apps.symbolic.md) + * `AdaptiveLasso` + * `AdaptiveLasso._penalty_jac()` + * `AdaptiveLasso.get_w()` + * `AdaptiveLasso.penalty()` + * `AdaptiveLasso.select()` + * `DantzigSelector` + * `DantzigSelector.construct_constraints()` + * `DantzigSelector.construct_jac()` + * `DantzigSelector.construct_loss()` + * `FeatureGenerator` + * `FeatureGenerator.augment()` + * `ISIS` + * `ISIS.evaluate()` + * `ISIS.run()` + * `L0BrutalForce` + * `L0BrutalForce.select()` + * `Lasso` + * `Lasso._penalty_jac()` + * `Lasso.penalty()` + * `Operator` + * `Operator.compute()` + * `Operator.from_str()` + * `Operator.gen_name()` + * `Operator.is_binary` + * `Operator.is_commutative` + * `Operator.is_unary` + * `Operator.support_op_rep` + * `SCAD` + * `SCAD._penalty_jac()` + * `SCAD.penalty()` + * `SIS` + * `SIS.compute_residual()` + * `SIS.run()` + * `SIS.screen()` + * `SIS.select()` + * `SIS.set_gamma()` + * `SIS.set_selector()` + * `SIS.update_gamma()` + * maml.apps.symbolic._feature_generator module + * `FeatureGenerator` + * `FeatureGenerator.augment()` + * `Operator` + * `Operator.compute()` + * `Operator.from_str()` + * `Operator.gen_name()` + * `Operator.is_binary` + * `Operator.is_commutative` + * `Operator.is_unary` + * `Operator.support_op_rep` + * `_my_abs_diff()` + * `_my_abs_log10()` + * `_my_abs_sqrt()` + * `_my_abs_sum()` + * `_my_diff()` + * `_my_div()` + * `_my_exp()` + * `_my_exp_power_2()` + * `_my_exp_power_3()` + * `_my_mul()` + * `_my_power()` + * `_my_sum()` + * `_my_sum_exp()` + * `_my_sum_power_2()` + * `_my_sum_power_3()` + * `_update_df()` + * `generate_feature()` + * maml.apps.symbolic._selectors module + * `AdaptiveLasso` + * `AdaptiveLasso._penalty_jac()` + * `AdaptiveLasso.get_w()` + * `AdaptiveLasso.penalty()` + * `AdaptiveLasso.select()` + * `BaseSelector` + * `BaseSelector._get_param_names()` + * `BaseSelector.compute_residual()` + * `BaseSelector.construct_constraints()` + * `BaseSelector.construct_jac()` + * `BaseSelector.construct_loss()` + * `BaseSelector.evaluate()` + * `BaseSelector.get_coef()` + * `BaseSelector.get_feature_indices()` + * `BaseSelector.get_params()` + * `BaseSelector.predict()` + * `BaseSelector.select()` + * `BaseSelector.set_params()` + * `DantzigSelector` + * `DantzigSelector.construct_constraints()` + * `DantzigSelector.construct_jac()` + * `DantzigSelector.construct_loss()` + * `L0BrutalForce` + * `L0BrutalForce.select()` + * `Lasso` + * `Lasso._penalty_jac()` + * `Lasso.penalty()` + * `PenalizedLeastSquares` + * `PenalizedLeastSquares._penalty_jac()` + * `PenalizedLeastSquares._sse_jac()` + * `PenalizedLeastSquares.construct_constraints()` + * `PenalizedLeastSquares.construct_jac()` + * `PenalizedLeastSquares.construct_loss()` + * `PenalizedLeastSquares.penalty()` + * `SCAD` + * `SCAD._penalty_jac()` + * `SCAD.penalty()` + * maml.apps.symbolic._selectors_cvxpy module + * `AdaptiveLassoCP` + * `AdaptiveLassoCP.get_w()` + * `AdaptiveLassoCP.penalty()` + * `AdaptiveLassoCP.select()` + * `BaseSelectorCP` + * `BaseSelectorCP.construct_constraints()` + * `BaseSelectorCP.construct_loss()` + * `BaseSelectorCP.select()` + * `DantzigSelectorCP` + * `DantzigSelectorCP.construct_constraints()` + * `DantzigSelectorCP.construct_loss()` + * `LassoCP` + * `LassoCP.penalty()` + * `PenalizedLeastSquaresCP` + * `PenalizedLeastSquaresCP.construct_loss()` + * `PenalizedLeastSquaresCP.penalty()` + * maml.apps.symbolic._sis module + * `ISIS` + * `ISIS.evaluate()` + * `ISIS.run()` + * `SIS` + * `SIS.compute_residual()` + * `SIS.run()` + * `SIS.screen()` + * `SIS.select()` + * `SIS.set_gamma()` + * `SIS.set_selector()` + * `SIS.update_gamma()` + * `_best_combination()` + * `_eval()` + * `_get_coeff()` +* [maml.base package](maml.base.md) + * `BaseDataSource` + * `BaseDataSource.get()` + * `BaseDescriber` + * `BaseDescriber._abc_impl` + * `BaseDescriber._is_multi_output()` + * `BaseDescriber._sklearn_auto_wrap_output_keys` + * `BaseDescriber.clear_cache()` + * `BaseDescriber.feature_dim` + * `BaseDescriber.fit()` + * `BaseDescriber.transform()` + * `BaseDescriber.transform_one()` + * `BaseModel` + * `BaseModel._predict()` + * `BaseModel.fit()` + * `BaseModel.predict_objs()` + * `BaseModel.train()` + * `DummyDescriber` + * `DummyDescriber._abc_impl` + * `DummyDescriber._sklearn_auto_wrap_output_keys` + * `DummyDescriber.transform_one()` + * `KerasModel` + * `KerasModel._get_validation_data()` + * `KerasModel.fit()` + * `SKLModel` + * `SequentialDescriber` + * `SequentialDescriber._abc_impl` + * `SequentialDescriber.steps` + * `TargetScalerMixin` + * `TargetScalerMixin.predict_objs()` + * `TargetScalerMixin.train()` + * `describer_type()` + * `get_feature_batch()` + * `is_keras_model()` + * `is_sklearn_model()` + * maml.base._data module + * `BaseDataSource` + * `BaseDataSource.get()` + * maml.base._describer module + * `BaseDescriber` + * `BaseDescriber._abc_impl` + * `BaseDescriber._is_multi_output()` + * `BaseDescriber._sklearn_auto_wrap_output_keys` + * `BaseDescriber.clear_cache()` + * `BaseDescriber.feature_dim` + * `BaseDescriber.fit()` + * `BaseDescriber.transform()` + * `BaseDescriber.transform_one()` + * `DummyDescriber` + * `DummyDescriber._abc_impl` + * `DummyDescriber._sklearn_auto_wrap_output_keys` + * `DummyDescriber.transform_one()` + * `SequentialDescriber` + * `SequentialDescriber._abc_impl` + * `SequentialDescriber.steps` + * `_transform_one()` + * `describer_type()` + * maml.base._feature_batch module + * `get_feature_batch()` + * `no_action()` + * `pandas_concat()` + * `stack_first_dim()` + * `stack_padded()` + * maml.base._mixin module + * `TargetScalerMixin` + * `TargetScalerMixin.predict_objs()` + * `TargetScalerMixin.train()` + * maml.base._model module + * `BaseModel` + * `BaseModel._predict()` + * `BaseModel.fit()` + * `BaseModel.predict_objs()` + * `BaseModel.train()` + * `KerasMixin` + * `KerasMixin.evaluate()` + * `KerasMixin.from_file()` + * `KerasMixin.get_input_dim()` + * `KerasMixin.load()` + * `KerasMixin.save()` + * `KerasModel` + * `KerasModel._get_validation_data()` + * `KerasModel.fit()` + * `SKLModel` + * `SklearnMixin` + * `SklearnMixin.evaluate()` + * `SklearnMixin.from_file()` + * `SklearnMixin.load()` + * `SklearnMixin.save()` + * `is_keras_model()` + * `is_sklearn_model()` +* [maml.data package](maml.data.md) + * `MaterialsProject` + * `MaterialsProject.get()` + * `URLSource` + * `URLSource.get()` + * maml.data._mp module + * `MaterialsProject` + * `MaterialsProject.get()` + * maml.data._url module + * `FigshareSource` + * `FigshareSource.get()` + * `URLSource` + * `URLSource.get()` +* [maml.describers package](maml.describers.md) + * `BPSymmetryFunctions` + * `BPSymmetryFunctions._abc_impl` + * `BPSymmetryFunctions._fc()` + * `BPSymmetryFunctions._sklearn_auto_wrap_output_keys` + * `BPSymmetryFunctions.describer_type` + * `BPSymmetryFunctions.transform_one()` + * `BispectrumCoefficients` + * `BispectrumCoefficients._abc_impl` + * `BispectrumCoefficients._sklearn_auto_wrap_output_keys` + * `BispectrumCoefficients.describer_type` + * `BispectrumCoefficients.feature_dim` + * `BispectrumCoefficients.subscripts` + * `BispectrumCoefficients.transform_one()` + * `CoulombEigenSpectrum` + * `CoulombEigenSpectrum._abc_impl` + * `CoulombEigenSpectrum._sklearn_auto_wrap_output_keys` + * `CoulombEigenSpectrum.describer_type` + * `CoulombEigenSpectrum.transform_one()` + * `CoulombMatrix` + * `CoulombMatrix._abc_impl` + * `CoulombMatrix._get_columb_mat()` + * `CoulombMatrix._sklearn_auto_wrap_output_keys` + * `CoulombMatrix.describer_type` + * `CoulombMatrix.get_coulomb_mat()` + * `CoulombMatrix.transform_one()` + * `DistinctSiteProperty` + * `DistinctSiteProperty._abc_impl` + * `DistinctSiteProperty._sklearn_auto_wrap_output_keys` + * `DistinctSiteProperty.describer_type` + * `DistinctSiteProperty.supported_properties` + * `DistinctSiteProperty.transform_one()` + * `ElementProperty` + * `ElementProperty._abc_impl` + * `ElementProperty._get_param_names()` + * `ElementProperty._sklearn_auto_wrap_output_keys` + * `ElementProperty.describer_type` + * `ElementProperty.from_preset()` + * `ElementProperty.get_params()` + * `ElementProperty.transform_one()` + * `ElementStats` + * `ElementStats.ALLOWED_STATS` + * `ElementStats.AVAILABLE_DATA` + * `ElementStats._abc_impl` + * `ElementStats._reduce_dimension()` + * `ElementStats._sklearn_auto_wrap_output_keys` + * `ElementStats.describer_type` + * `ElementStats.from_data()` + * `ElementStats.from_file()` + * `ElementStats.transform_one()` + * `M3GNetStructure` + * `M3GNetStructure._abc_impl` + * `M3GNetStructure._sklearn_auto_wrap_output_keys` + * `M3GNetStructure.transform_one()` + * `MEGNetSite` + * `MEGNetSite._abc_impl` + * `MEGNetSite._sklearn_auto_wrap_output_keys` + * `MEGNetSite.describer_type` + * `MEGNetSite.transform_one()` + * `MEGNetStructure` + * `MEGNetStructure._abc_impl` + * `MEGNetStructure._sklearn_auto_wrap_output_keys` + * `MEGNetStructure.describer_type` + * `MEGNetStructure.transform_one()` + * `RadialDistributionFunction` + * `RadialDistributionFunction._get_specie_density()` + * `RadialDistributionFunction.get_site_coordination()` + * `RadialDistributionFunction.get_site_rdf()` + * `RadialDistributionFunction.get_species_coordination()` + * `RadialDistributionFunction.get_species_rdf()` + * `RandomizedCoulombMatrix` + * `RandomizedCoulombMatrix._abc_impl` + * `RandomizedCoulombMatrix._sklearn_auto_wrap_output_keys` + * `RandomizedCoulombMatrix.describer_type` + * `RandomizedCoulombMatrix.get_randomized_coulomb_mat()` + * `RandomizedCoulombMatrix.transform_one()` + * `SiteElementProperty` + * `SiteElementProperty._abc_impl` + * `SiteElementProperty._get_keys()` + * `SiteElementProperty._sklearn_auto_wrap_output_keys` + * `SiteElementProperty.describer_type` + * `SiteElementProperty.feature_dim` + * `SiteElementProperty.transform_one()` + * `SmoothOverlapAtomicPosition` + * `SmoothOverlapAtomicPosition._abc_impl` + * `SmoothOverlapAtomicPosition._sklearn_auto_wrap_output_keys` + * `SmoothOverlapAtomicPosition.describer_type` + * `SmoothOverlapAtomicPosition.transform_one()` + * `SortedCoulombMatrix` + * `SortedCoulombMatrix._abc_impl` + * `SortedCoulombMatrix._sklearn_auto_wrap_output_keys` + * `SortedCoulombMatrix.describer_type` + * `SortedCoulombMatrix.get_sorted_coulomb_mat()` + * `SortedCoulombMatrix.transform_one()` + * `wrap_matminer_describer()` + * maml.describers._composition module + * `ElementStats` + * `ElementStats.ALLOWED_STATS` + * `ElementStats.AVAILABLE_DATA` + * `ElementStats._abc_impl` + * `ElementStats._reduce_dimension()` + * `ElementStats._sklearn_auto_wrap_output_keys` + * `ElementStats.describer_type` + * `ElementStats.from_data()` + * `ElementStats.from_file()` + * `ElementStats.transform_one()` + * `_is_element_or_specie()` + * `_keys_are_elements()` + * maml.describers._m3gnet module + * `M3GNetStructure` + * `M3GNetStructure._abc_impl` + * `M3GNetStructure._sklearn_auto_wrap_output_keys` + * `M3GNetStructure.transform_one()` + * maml.describers._matminer module + * `wrap_matminer_describer()` + * maml.describers._megnet module + * `MEGNetNotFound` + * `MEGNetSite` + * `MEGNetSite._abc_impl` + * `MEGNetSite._sklearn_auto_wrap_output_keys` + * `MEGNetSite.describer_type` + * `MEGNetSite.transform_one()` + * `MEGNetStructure` + * `MEGNetStructure._abc_impl` + * `MEGNetStructure._sklearn_auto_wrap_output_keys` + * `MEGNetStructure.describer_type` + * `MEGNetStructure.transform_one()` + * `_load_model()` + * maml.describers._rdf module + * `RadialDistributionFunction` + * `RadialDistributionFunction._get_specie_density()` + * `RadialDistributionFunction.get_site_coordination()` + * `RadialDistributionFunction.get_site_rdf()` + * `RadialDistributionFunction.get_species_coordination()` + * `RadialDistributionFunction.get_species_rdf()` + * `_dist_to_counts()` + * `get_pair_distances()` + * maml.describers._site module + * `BPSymmetryFunctions` + * `BPSymmetryFunctions._abc_impl` + * `BPSymmetryFunctions._fc()` + * `BPSymmetryFunctions._sklearn_auto_wrap_output_keys` + * `BPSymmetryFunctions.describer_type` + * `BPSymmetryFunctions.transform_one()` + * `BispectrumCoefficients` + * `BispectrumCoefficients._abc_impl` + * `BispectrumCoefficients._sklearn_auto_wrap_output_keys` + * `BispectrumCoefficients.describer_type` + * `BispectrumCoefficients.feature_dim` + * `BispectrumCoefficients.subscripts` + * `BispectrumCoefficients.transform_one()` + * `MEGNetSite` + * `MEGNetSite._abc_impl` + * `MEGNetSite._sklearn_auto_wrap_output_keys` + * `MEGNetSite.describer_type` + * `MEGNetSite.transform_one()` + * `SiteElementProperty` + * `SiteElementProperty._abc_impl` + * `SiteElementProperty._get_keys()` + * `SiteElementProperty._sklearn_auto_wrap_output_keys` + * `SiteElementProperty.describer_type` + * `SiteElementProperty.feature_dim` + * `SiteElementProperty.transform_one()` + * `SmoothOverlapAtomicPosition` + * `SmoothOverlapAtomicPosition._abc_impl` + * `SmoothOverlapAtomicPosition._sklearn_auto_wrap_output_keys` + * `SmoothOverlapAtomicPosition.describer_type` + * `SmoothOverlapAtomicPosition.transform_one()` + * maml.describers._spectrum module + * maml.describers._structure module + * `CoulombEigenSpectrum` + * `CoulombEigenSpectrum._abc_impl` + * `CoulombEigenSpectrum._sklearn_auto_wrap_output_keys` + * `CoulombEigenSpectrum.describer_type` + * `CoulombEigenSpectrum.transform_one()` + * `CoulombMatrix` + * `CoulombMatrix._abc_impl` + * `CoulombMatrix._get_columb_mat()` + * `CoulombMatrix._sklearn_auto_wrap_output_keys` + * `CoulombMatrix.describer_type` + * `CoulombMatrix.get_coulomb_mat()` + * `CoulombMatrix.transform_one()` + * `DistinctSiteProperty` + * `DistinctSiteProperty._abc_impl` + * `DistinctSiteProperty._sklearn_auto_wrap_output_keys` + * `DistinctSiteProperty.describer_type` + * `DistinctSiteProperty.supported_properties` + * `DistinctSiteProperty.transform_one()` + * `RandomizedCoulombMatrix` + * `RandomizedCoulombMatrix._abc_impl` + * `RandomizedCoulombMatrix._sklearn_auto_wrap_output_keys` + * `RandomizedCoulombMatrix.describer_type` + * `RandomizedCoulombMatrix.get_randomized_coulomb_mat()` + * `RandomizedCoulombMatrix.transform_one()` + * `SortedCoulombMatrix` + * `SortedCoulombMatrix._abc_impl` + * `SortedCoulombMatrix._sklearn_auto_wrap_output_keys` + * `SortedCoulombMatrix.describer_type` + * `SortedCoulombMatrix.get_sorted_coulomb_mat()` + * `SortedCoulombMatrix.transform_one()` +* [maml.models package](maml.models.md) + * `AtomSets` + * `AtomSets._get_data_generator()` + * `AtomSets._predict()` + * `AtomSets.evaluate()` + * `AtomSets.fit()` + * `AtomSets.from_dir()` + * `AtomSets.save()` + * `KerasModel` + * `KerasModel._get_validation_data()` + * `KerasModel.fit()` + * `MLP` + * `SKLModel` + * `WeightedAverageLayer` + * `WeightedAverageLayer.build()` + * `WeightedAverageLayer.call()` + * `WeightedAverageLayer.compute_output_shape()` + * `WeightedAverageLayer.get_config()` + * `WeightedAverageLayer.reduce_sum()` + * `WeightedSet2Set` + * `WeightedSet2Set._lstm()` + * `WeightedSet2Set.build()` + * `WeightedSet2Set.call()` + * `WeightedSet2Set.compute_output_shape()` + * `WeightedSet2Set.get_config()` + * Subpackages + * [maml.models.dl package](maml.models.dl.md) + * `AtomSets` + * `AtomSets._get_data_generator()` + * `AtomSets._predict()` + * `AtomSets.evaluate()` + * `AtomSets.fit()` + * `AtomSets.from_dir()` + * `AtomSets.save()` + * `MLP` + * `WeightedAverageLayer` + * `WeightedAverageLayer.build()` + * `WeightedAverageLayer.call()` + * `WeightedAverageLayer.compute_output_shape()` + * `WeightedAverageLayer.get_config()` + * `WeightedAverageLayer.reduce_sum()` + * `WeightedSet2Set` + * `WeightedSet2Set._lstm()` + * `WeightedSet2Set.build()` + * `WeightedSet2Set.call()` + * `WeightedSet2Set.compute_output_shape()` + * `WeightedSet2Set.get_config()` + * maml.models.dl._atomsets module + * `AtomSets` + * `AtomSets._get_data_generator()` + * `AtomSets._predict()` + * `AtomSets.evaluate()` + * `AtomSets.fit()` + * `AtomSets.from_dir()` + * `AtomSets.save()` + * `construct_atom_sets()` + * maml.models.dl._keras_utils module + * `deserialize_keras_activation()` + * `deserialize_keras_optimizer()` + * maml.models.dl._layers module + * `WeightedAverageLayer` + * `WeightedAverageLayer.build()` + * `WeightedAverageLayer.call()` + * `WeightedAverageLayer.compute_output_shape()` + * `WeightedAverageLayer.get_config()` + * `WeightedAverageLayer.reduce_sum()` + * `WeightedSet2Set` + * `WeightedSet2Set._lstm()` + * `WeightedSet2Set.build()` + * `WeightedSet2Set.call()` + * `WeightedSet2Set.compute_output_shape()` + * `WeightedSet2Set.get_config()` + * maml.models.dl._mlp module + * `MLP` + * `construct_mlp()` +* [maml.sampling package](maml.sampling.md) + * maml.sampling.clustering module + * `BirchClustering` + * `BirchClustering._sklearn_auto_wrap_output_keys` + * `BirchClustering.fit()` + * `BirchClustering.transform()` + * maml.sampling.direct module + * maml.sampling.pca module + * `PrincipalComponentAnalysis` + * `PrincipalComponentAnalysis._sklearn_auto_wrap_output_keys` + * `PrincipalComponentAnalysis.fit()` + * `PrincipalComponentAnalysis.transform()` + * maml.sampling.stratified_sampling module + * `SelectKFromClusters` + * `SelectKFromClusters._sklearn_auto_wrap_output_keys` + * `SelectKFromClusters.fit()` + * `SelectKFromClusters.transform()` +* [maml.utils package](maml.utils.md) + * `ConstantValue` + * `ConstantValue.get_value()` + * `DataSplitter` + * `DataSplitter.split()` + * `DummyScaler` + * `DummyScaler.from_training_data()` + * `DummyScaler.inverse_transform()` + * `DummyScaler.transform()` + * `LinearProfile` + * `LinearProfile.get_value()` + * `MultiScratchDir` + * `MultiScratchDir.SCR_LINK` + * `Scaler` + * `Scaler.inverse_transform()` + * `Scaler.transform()` + * `ShuffleSplitter` + * `ShuffleSplitter.split()` + * `StandardScaler` + * `StandardScaler.from_training_data()` + * `StandardScaler.inverse_transform()` + * `StandardScaler.transform()` + * `Stats` + * `Stats.allowed_stats` + * `Stats.average()` + * `Stats.geometric_mean()` + * `Stats.harmonic_mean()` + * `Stats.inverse_mean()` + * `Stats.kurtosis()` + * `Stats.max()` + * `Stats.mean()` + * `Stats.mean_absolute_deviation()` + * `Stats.mean_absolute_error()` + * `Stats.min()` + * `Stats.mode()` + * `Stats.moment()` + * `Stats.power_mean()` + * `Stats.range()` + * `Stats.shifted_geometric_mean()` + * `Stats.skewness()` + * `Stats.std()` + * `ValueProfile` + * `ValueProfile.get_value()` + * `ValueProfile.get_value()` + * `ValueProfile.increment_step()` + * `check_structures_forces_stresses()` + * `convert_docs()` + * `cwt()` + * `feature_dim_from_test_system()` + * `fft_magnitude()` + * `get_describer_dummy_obj()` + * `get_full_args()` + * `get_full_stats_and_funcs()` + * `get_lammps_lattice_and_rotation()` + * `get_sp_method()` + * `njit()` + * `pool_from()` + * `spectrogram()` + * `stats_list_conversion()` + * `stress_format_change()` + * `stress_list_to_matrix()` + * `stress_matrix_to_list()` + * `to_array()` + * `to_composition()` + * `write_data_from_structure()` + * `wvd()` + * maml.utils._data_conversion module * `convert_docs()` - - - * `cwt()` - - + * `doc_from()` + * `pool_from()` + * `to_array()` + * maml.utils._data_split module + * `DataSplitter` + * `DataSplitter.split()` + * `ShuffleSplitter` + * `ShuffleSplitter.split()` + * maml.utils._dummy module * `feature_dim_from_test_system()` - - - * `fft_magnitude()` - - * `get_describer_dummy_obj()` - - + * maml.utils._inspect module * `get_full_args()` - - - * `get_full_stats_and_funcs()` - - - * `get_lammps_lattice_and_rotation()` - - - * `get_sp_method()` - - + * `get_param_types()` + * maml.utils._jit module * `njit()` - - - * `pool_from()` - - - * `spectrogram()` - - - * `stats_list_conversion()` - - + * maml.utils._lammps module + * `_get_atomic_mass()` + * `_get_charge()` + * `check_structures_forces_stresses()` + * `get_lammps_lattice_and_rotation()` * `stress_format_change()` - - * `stress_list_to_matrix()` - - * `stress_matrix_to_list()` - - - * `to_array()` - - - * `to_composition()` - - * `write_data_from_structure()` - - + * maml.utils._material module + * `to_composition()` + * maml.utils._preprocessing module + * `DummyScaler` + * `DummyScaler.from_training_data()` + * `DummyScaler.inverse_transform()` + * `DummyScaler.transform()` + * `Scaler` + * `Scaler.inverse_transform()` + * `Scaler.transform()` + * `StandardScaler` + * `StandardScaler.from_training_data()` + * `StandardScaler.inverse_transform()` + * `StandardScaler.transform()` + * maml.utils._signal_processing module + * `cwt()` + * `fft_magnitude()` + * `get_sp_method()` + * `spectrogram()` * `wvd()` - - - * maml.utils._data_conversion module - - - * `convert_docs()` - - - * `doc_from()` - - - * `pool_from()` - - - * `to_array()` - - - * maml.utils._data_split module - - - * `DataSplitter` - - - * `DataSplitter.split()` - - - * `ShuffleSplitter` - - - * `ShuffleSplitter.split()` - - - * maml.utils._dummy module - - - * `feature_dim_from_test_system()` - - - * `get_describer_dummy_obj()` - - - * maml.utils._inspect module - - - * `get_full_args()` - - - * `get_param_types()` - - - * maml.utils._jit module - - - * `njit()` - - - * maml.utils._lammps module - - - * `_get_atomic_mass()` - - - * `_get_charge()` - - - * `check_structures_forces_stresses()` - - - * `get_lammps_lattice_and_rotation()` - - - * `stress_format_change()` - - - * `stress_list_to_matrix()` - - - * `stress_matrix_to_list()` - - - * `write_data_from_structure()` - - - * maml.utils._material module - - - * `to_composition()` - - - * maml.utils._preprocessing module - - - * `DummyScaler` - - - * `DummyScaler.from_training_data()` - - - * `DummyScaler.inverse_transform()` - - - * `DummyScaler.transform()` - - - * `Scaler` - - - * `Scaler.inverse_transform()` - - - * `Scaler.transform()` - - - * `StandardScaler` - - - * `StandardScaler.from_training_data()` - - - * `StandardScaler.inverse_transform()` - - - * `StandardScaler.transform()` - - - * maml.utils._signal_processing module - - - * `cwt()` - - - * `fft_magnitude()` - - - * `get_sp_method()` - - - * `spectrogram()` - - - * `wvd()` - - - * maml.utils._stats module - - - * `Stats` - - - * `Stats.allowed_stats` - - - * `Stats.average()` - - - * `Stats.geometric_mean()` - - - * `Stats.harmonic_mean()` - - - * `Stats.inverse_mean()` - - - * `Stats.kurtosis()` - - - * `Stats.max()` - - - * `Stats.mean()` - - - * `Stats.mean_absolute_deviation()` - - - * `Stats.mean_absolute_error()` - - - * `Stats.min()` - - - * `Stats.mode()` - - - * `Stats.moment()` - - - * `Stats.power_mean()` - - - * `Stats.range()` - - - * `Stats.shifted_geometric_mean()` - - - * `Stats.skewness()` - - - * `Stats.std()` - - - * `_add_allowed_stats()` - - - * `_convert_a_or_b()` - - - * `_moment_symbol_conversion()` - - - * `_root_moment()` - - - * `get_full_stats_and_funcs()` - - - * `stats_list_conversion()` - - - * maml.utils._tempfile module - - - * `MultiScratchDir` - - - * `MultiScratchDir.SCR_LINK` - - - * `MultiScratchDir.tempdirs` - - - * `_copy_r_with_suffix()` - - - * maml.utils._typing module - - - * maml.utils._value_profile module - - - * `ConstantValue` - - - * `ConstantValue.get_value()` - - - * `LinearProfile` - - - * `LinearProfile.get_value()` - - - * `ValueProfile` - - - * `ValueProfile.get_value()` - - - * `ValueProfile.get_value()` - - - * `ValueProfile.increment_step()` \ No newline at end of file + * maml.utils._stats module + * `Stats` + * `Stats.allowed_stats` + * `Stats.average()` + * `Stats.geometric_mean()` + * `Stats.harmonic_mean()` + * `Stats.inverse_mean()` + * `Stats.kurtosis()` + * `Stats.max()` + * `Stats.mean()` + * `Stats.mean_absolute_deviation()` + * `Stats.mean_absolute_error()` + * `Stats.min()` + * `Stats.mode()` + * `Stats.moment()` + * `Stats.power_mean()` + * `Stats.range()` + * `Stats.shifted_geometric_mean()` + * `Stats.skewness()` + * `Stats.std()` + * `_add_allowed_stats()` + * `_convert_a_or_b()` + * `_moment_symbol_conversion()` + * `_root_moment()` + * `get_full_stats_and_funcs()` + * `stats_list_conversion()` + * maml.utils._tempfile module + * `MultiScratchDir` + * `MultiScratchDir.SCR_LINK` + * `MultiScratchDir.tempdirs` + * `_copy_r_with_suffix()` + * maml.utils._typing module + * maml.utils._value_profile module + * `ConstantValue` + * `ConstantValue.get_value()` + * `LinearProfile` + * `LinearProfile.get_value()` + * `ValueProfile` + * `ValueProfile.get_value()` + * `ValueProfile.get_value()` + * `ValueProfile.increment_step()` \ No newline at end of file diff --git a/docs/maml.models.dl.md b/docs/maml.models.dl.md index 17ebee44..73b9f7cb 100644 --- a/docs/maml.models.dl.md +++ b/docs/maml.models.dl.md @@ -14,56 +14,37 @@ Bases: `KerasModel` This class implements the DeepSets models. -### _get_data_generator(features, targets, batch_size=128, is_shuffle=True) +### \_get_data_generator(features, targets, batch_size=128, is_shuffle=True) -### _predict(features: ndarray, \*\*kwargs) +### \_predict(features: ndarray, \*\*kwargs) Predict the values given a set of inputs based on fitted models. - * **Parameters** -**features** (*np.ndarray*) – array-like input features. - - + **features** (*np.ndarray*) – array-like input features. * **Returns** -List of output objects. + List of output objects. ### evaluate(eval_objs, eval_targets, is_feature: bool = False, batch_size: int = 16) Evaluate objs, targets. - * **Parameters** - - * **eval_objs** (*list*) – objs for evaluation - - - * **eval_targets** (*list*) – target list for the corresponding objects - - - * **is_feature** (*bool*) – whether x is feature matrix - - - * **batch_size** (*int*) – evaluation batch size + * **eval_objs** (*list*) – objs for evaluation + * **eval_targets** (*list*) – target list for the corresponding objects + * **is_feature** (*bool*) – whether x is feature matrix + * **batch_size** (*int*) – evaluation batch size ### fit(features: list | np.ndarray, targets: list | np.ndarray | None = None, val_features: list | np.ndarray | None = None, val_targets: list | np.ndarray | None = None, \*\*kwargs) - * **Parameters** - - * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or -numpy array with dim (m, n) where m is the number of data and -n is the feature dimension. - - - * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or -numpy array with dim (m, ). - - - * **val_features** (*list*\* or \**np.ndarray*) – validation features - - - * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. + * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or + numpy array with dim (m, n) where m is the number of data and + n is the feature dimension. + * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or + numpy array with dim (m, ). + * **val_features** (*list*\* or \**np.ndarray*) – validation features + * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. ### *classmethod* from_dir(dirname: str) @@ -77,9 +58,8 @@ Returns: object instance. Save the models and describers. - * **Parameters** -**dirname** (*str*) – dirname for save + **dirname** (*str*) – dirname for save ## *class* maml.models.dl.MLP(input_dim: int | None = None, describer: BaseDescriber | None = None, n_neurons: tuple = (64, 64), activation: str = ‘relu’, n_targets: int = 1, is_classification: bool = False, optimizer: str = ‘adam’, loss: str = ‘mse’, compile_metrics: tuple = (), \*\*kwargs) @@ -99,21 +79,16 @@ result= sum{w_i^a \* value_i} / sum{w_i^a} Build the layer. - * **Parameters** -**input_shape** (*tuple*) – input shape tuple + **input_shape** (*tuple*) – input shape tuple ### call(inputs: Sequence, mask: tf.Tensor | None = None) Core logic of the layer. - * **Parameters** - - * **inputs** (*tuple*) – input tuple of length 3 - - - * **mask** (*tf.Tensor*) – not used here + * **inputs** (*tuple*) – input tuple of length 3 + * **mask** (*tf.Tensor*) – not used here ### *static* compute_output_shape(input_shape: Sequence) @@ -129,16 +104,10 @@ Get layer configuration. Reduce sum the tensors using index. - * **Parameters** - - * **prop** (*tf.Tensor*) – tensor with shape [1, n, …] - - - * **index** (*tf.Tensor*) – integer tensor with shape [1, n] - - - * **perm** (*list*) – permutation for transpose. + * **prop** (*tf.Tensor*) – tensor with shape [1, n, …] + * **index** (*tf.Tensor*) – integer tensor with shape [1, n] + * **perm** (*list*) – permutation for transpose. ## *class* maml.models.dl.WeightedSet2Set(\*args, \*\*kwargs) @@ -149,7 +118,7 @@ Here, in addition to taking features and indices as inputs, we also take a weight tensor. The input to the core logic is [features, weights, indices]. -### _lstm(h, c) +### \_lstm(h, c) ### build(input_shape: Sequence) @@ -161,13 +130,9 @@ Build the output shape from input shapes Core logic of the layer. - * **Parameters** - - * **inputs** (*tuple*) – input tuple of length 3 - - - * **mask** (*tf.Tensor*) – not used here + * **inputs** (*tuple*) – input tuple of length 3 + * **mask** (*tf.Tensor*) – not used here ### compute_output_shape(input_shape) @@ -180,10 +145,8 @@ Returns: sequence of tuples output shapes ### get_config() > Part of keras layer interface, where the signature is converted into a dict - - * **Returns** -configurational dictionary. + configurational dictionary. ## maml.models.dl._atomsets module @@ -195,56 +158,37 @@ Bases: `KerasModel` This class implements the DeepSets models. -#### _get_data_generator(features, targets, batch_size=128, is_shuffle=True) +#### \_get_data_generator(features, targets, batch_size=128, is_shuffle=True) -#### _predict(features: ndarray, \*\*kwargs) +#### \_predict(features: ndarray, \*\*kwargs) Predict the values given a set of inputs based on fitted models. - * **Parameters** -**features** (*np.ndarray*) – array-like input features. - - + **features** (*np.ndarray*) – array-like input features. * **Returns** -List of output objects. + List of output objects. #### evaluate(eval_objs, eval_targets, is_feature: bool = False, batch_size: int = 16) Evaluate objs, targets. - * **Parameters** - - * **eval_objs** (*list*) – objs for evaluation - - - * **eval_targets** (*list*) – target list for the corresponding objects - - - * **is_feature** (*bool*) – whether x is feature matrix - - - * **batch_size** (*int*) – evaluation batch size + * **eval_objs** (*list*) – objs for evaluation + * **eval_targets** (*list*) – target list for the corresponding objects + * **is_feature** (*bool*) – whether x is feature matrix + * **batch_size** (*int*) – evaluation batch size #### fit(features: list | np.ndarray, targets: list | np.ndarray | None = None, val_features: list | np.ndarray | None = None, val_targets: list | np.ndarray | None = None, \*\*kwargs) - * **Parameters** - - * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or -numpy array with dim (m, n) where m is the number of data and -n is the feature dimension. - - - * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or -numpy array with dim (m, ). - - - * **val_features** (*list*\* or \**np.ndarray*) – validation features - - - * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. + * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or + numpy array with dim (m, n) where m is the number of data and + n is the feature dimension. + * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or + numpy array with dim (m, ). + * **val_features** (*list*\* or \**np.ndarray*) – validation features + * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. #### *classmethod* from_dir(dirname: str) @@ -258,9 +202,8 @@ Returns: object instance. Save the models and describers. - * **Parameters** -**dirname** (*str*) – dirname for save + **dirname** (*str*) – dirname for save ### maml.models.dl._atomsets.construct_atom_sets(input_dim: int | None = None, is_embedding: bool = True, n_neurons: Sequence[int] = (64, 64), n_neurons_final: Sequence[int] = (64, 64), n_targets: int = 1, activation: str = ‘relu’, embedding_vcal: int = 95, embedding_dim: int = 32, symmetry_func: list[str] | str = ‘mean’, optimizer: str = ‘adam’, loss: str = ‘mse’, compile_metrics: tuple = (), is_classification: bool = False, \*\*symmetry_func_kwargs) @@ -269,47 +212,21 @@ phi is implemented as a neural network and rho is a symmetry function. todo: implement attention mechanism - * **Parameters** - - * **input_dim** (*int*) – input dimension, if None, then integer inputs + embedding are assumed. - - - * **is_embedding** (*bool*) – whether the input should be embedded - - - * **n_neurons** (*tuple*) – number of hidden-layer neurons before passing to symmetry function - - - * **n_neurons_final** (*tuple*) – number of hidden-layer neurons after symmetry function - - - * **n_targets** (*int*) – number of output targets - - - * **activation** (*str*) – activation function - - - * **embedding_vcal** (*int*) – int, embedding vocabulary - - - * **embedding_dim** (*int*) – int, embedding dimension - - - * **symmetry_func** (*str*) – symmetry function, choose from [‘set2set’, ‘sum’, ‘mean’, -‘max’, ‘min’, ‘prod’] - - - * **optimizer** (*str*) – optimizer for the models - - - * **loss** (*str*) – loss function for the models - - - * **compile_metrics** (*tuple*) – metrics for validation - - - * **symmetry_func_kwargs** (*dict*) – kwargs for symmetry function + * **input_dim** (*int*) – input dimension, if None, then integer inputs + embedding are assumed. + * **is_embedding** (*bool*) – whether the input should be embedded + * **n_neurons** (*tuple*) – number of hidden-layer neurons before passing to symmetry function + * **n_neurons_final** (*tuple*) – number of hidden-layer neurons after symmetry function + * **n_targets** (*int*) – number of output targets + * **activation** (*str*) – activation function + * **embedding_vcal** (*int*) – int, embedding vocabulary + * **embedding_dim** (*int*) – int, embedding dimension + * **symmetry_func** (*str*) – symmetry function, choose from [‘set2set’, ‘sum’, ‘mean’, + ‘max’, ‘min’, ‘prod’] + * **optimizer** (*str*) – optimizer for the models + * **loss** (*str*) – loss function for the models + * **compile_metrics** (*tuple*) – metrics for validation + * **symmetry_func_kwargs** (*dict*) – kwargs for symmetry function ## maml.models.dl._keras_utils module @@ -319,9 +236,8 @@ Keras utils for deserialize activations and otpimizers. serialize keras activation. - * **Parameters** -**activation** (*str*\*, **dict**, or \**Activation object*) – activation to serialize + **activation** (*str*\*, **dict**, or \**Activation object*) – activation to serialize Returns: Activation object @@ -329,9 +245,8 @@ Returns: Activation object serialize keras activation. - * **Parameters** -**optimizer** (*str*\*, **dict**, or \**optimizer object*) – optimizer to serialize + **optimizer** (*str*\*, **dict**, or \**optimizer object*) – optimizer to serialize Returns: Activation object @@ -351,21 +266,16 @@ result= sum{w_i^a \* value_i} / sum{w_i^a} Build the layer. - * **Parameters** -**input_shape** (*tuple*) – input shape tuple + **input_shape** (*tuple*) – input shape tuple #### call(inputs: Sequence, mask: tf.Tensor | None = None) Core logic of the layer. - * **Parameters** - - * **inputs** (*tuple*) – input tuple of length 3 - - - * **mask** (*tf.Tensor*) – not used here + * **inputs** (*tuple*) – input tuple of length 3 + * **mask** (*tf.Tensor*) – not used here #### *static* compute_output_shape(input_shape: Sequence) @@ -381,16 +291,10 @@ Get layer configuration. Reduce sum the tensors using index. - * **Parameters** - - * **prop** (*tf.Tensor*) – tensor with shape [1, n, …] - - - * **index** (*tf.Tensor*) – integer tensor with shape [1, n] - - - * **perm** (*list*) – permutation for transpose. + * **prop** (*tf.Tensor*) – tensor with shape [1, n, …] + * **index** (*tf.Tensor*) – integer tensor with shape [1, n] + * **perm** (*list*) – permutation for transpose. ### *class* maml.models.dl._layers.WeightedSet2Set(\*args, \*\*kwargs) @@ -401,7 +305,7 @@ Here, in addition to taking features and indices as inputs, we also take a weight tensor. The input to the core logic is [features, weights, indices]. -#### _lstm(h, c) +#### \_lstm(h, c) #### build(input_shape: Sequence) @@ -413,13 +317,9 @@ Build the output shape from input shapes Core logic of the layer. - * **Parameters** - - * **inputs** (*tuple*) – input tuple of length 3 - - - * **mask** (*tf.Tensor*) – not used here + * **inputs** (*tuple*) – input tuple of length 3 + * **mask** (*tf.Tensor*) – not used here #### compute_output_shape(input_shape) @@ -432,10 +332,8 @@ Returns: sequence of tuples output shapes #### get_config() > Part of keras layer interface, where the signature is converted into a dict - - * **Returns** -configurational dictionary. + configurational dictionary. ## maml.models.dl._mlp module @@ -451,28 +349,12 @@ This class implements the multi-layer perceptron models. Constructor for multi-layer perceptron models. - * **Parameters** - - * **input_dim** (*int*) – input dimension, i.e., feature dimension - - - * **n_neurons** (*tuple*) – list of hidden neuron sizes - - - * **activation** (*str*) – activation function - - - * **n_targets** (*int*) – number of targets - - - * **is_classification** (*bool*) – whether the target is a classification problem - - - * **optimizer** (*str*) – optimizer - - - * **loss** (*str*) – loss function - - - * **compile_metrics** (*tuple*) – metrics to evaluate during epochs \ No newline at end of file + * **input_dim** (*int*) – input dimension, i.e., feature dimension + * **n_neurons** (*tuple*) – list of hidden neuron sizes + * **activation** (*str*) – activation function + * **n_targets** (*int*) – number of targets + * **is_classification** (*bool*) – whether the target is a classification problem + * **optimizer** (*str*) – optimizer + * **loss** (*str*) – loss function + * **compile_metrics** (*tuple*) – metrics to evaluate during epochs \ No newline at end of file diff --git a/docs/maml.models.md b/docs/maml.models.md index d343a7a7..a789c030 100644 --- a/docs/maml.models.md +++ b/docs/maml.models.md @@ -14,56 +14,37 @@ Bases: `KerasModel` This class implements the DeepSets models. -### _get_data_generator(features, targets, batch_size=128, is_shuffle=True) +### \_get_data_generator(features, targets, batch_size=128, is_shuffle=True) -### _predict(features: ndarray, \*\*kwargs) +### \_predict(features: ndarray, \*\*kwargs) Predict the values given a set of inputs based on fitted models. - * **Parameters** -**features** (*np.ndarray*) – array-like input features. - - + **features** (*np.ndarray*) – array-like input features. * **Returns** -List of output objects. + List of output objects. ### evaluate(eval_objs, eval_targets, is_feature: bool = False, batch_size: int = 16) Evaluate objs, targets. - * **Parameters** - - * **eval_objs** (*list*) – objs for evaluation - - - * **eval_targets** (*list*) – target list for the corresponding objects - - - * **is_feature** (*bool*) – whether x is feature matrix - - - * **batch_size** (*int*) – evaluation batch size + * **eval_objs** (*list*) – objs for evaluation + * **eval_targets** (*list*) – target list for the corresponding objects + * **is_feature** (*bool*) – whether x is feature matrix + * **batch_size** (*int*) – evaluation batch size ### fit(features: list | np.ndarray, targets: list | np.ndarray | None = None, val_features: list | np.ndarray | None = None, val_targets: list | np.ndarray | None = None, \*\*kwargs) - * **Parameters** - - * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or -numpy array with dim (m, n) where m is the number of data and -n is the feature dimension. - - - * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or -numpy array with dim (m, ). - - - * **val_features** (*list*\* or \**np.ndarray*) – validation features - - - * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. + * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or + numpy array with dim (m, n) where m is the number of data and + n is the feature dimension. + * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or + numpy array with dim (m, ). + * **val_features** (*list*\* or \**np.ndarray*) – validation features + * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. ### *classmethod* from_dir(dirname: str) @@ -77,9 +58,8 @@ Returns: object instance. Save the models and describers. - * **Parameters** -**dirname** (*str*) – dirname for save + **dirname** (*str*) – dirname for save ## *class* maml.models.KerasModel(model, describer: BaseDescriber | None = None, \*\*kwargs) @@ -87,33 +67,23 @@ Bases: `BaseModel`, `KerasMixin` MAML models with keras models as estimators. -### *static* _get_validation_data(val_features, val_targets, \*\*val_kwargs) +### *static* \_get_validation_data(val_features, val_targets, \*\*val_kwargs) construct validation data, the default is just returning a list of val_features and val_targets. ### fit(features: list | np.ndarray, targets: list | np.ndarray | None = None, val_features: list | np.ndarray | None = None, val_targets: list | np.ndarray | None = None, \*\*kwargs) - * **Parameters** - - * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or -numpy array with dim (m, n) where m is the number of data and -n is the feature dimension. - - - * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or -numpy array with dim (m, ). - - - * **val_features** (*list*\* or \**np.ndarray*) – validation features - - - * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. - - + * **features** (*list*\* or \**np.ndarray*) – Numerical input feature list or + numpy array with dim (m, n) where m is the number of data and + n is the feature dimension. + * **targets** (*list*\* or \**np.ndarray*) – Numerical output target list, or + numpy array with dim (m, ). + * **val_features** (*list*\* or \**np.ndarray*) – validation features + * **val_targets** (*list*\* or \**np.ndarray*) – validation targets. * **Returns** -self + self ## *class* maml.models.MLP(input_dim: int | None = None, describer: BaseDescriber | None = None, n_neurons: tuple = (64, 64), activation: str = ‘relu’, n_targets: int = 1, is_classification: bool = False, optimizer: str = ‘adam’, loss: str = ‘mse’, compile_metrics: tuple = (), \*\*kwargs) @@ -139,21 +109,16 @@ result= sum{w_i^a \* value_i} / sum{w_i^a} Build the layer. - * **Parameters** -**input_shape** (*tuple*) – input shape tuple + **input_shape** (*tuple*) – input shape tuple ### call(inputs: Sequence, mask: tf.Tensor | None = None) Core logic of the layer. - * **Parameters** - - * **inputs** (*tuple*) – input tuple of length 3 - - - * **mask** (*tf.Tensor*) – not used here + * **inputs** (*tuple*) – input tuple of length 3 + * **mask** (*tf.Tensor*) – not used here ### *static* compute_output_shape(input_shape: Sequence) @@ -169,16 +134,10 @@ Get layer configuration. Reduce sum the tensors using index. - * **Parameters** - - * **prop** (*tf.Tensor*) – tensor with shape [1, n, …] - - - * **index** (*tf.Tensor*) – integer tensor with shape [1, n] - - - * **perm** (*list*) – permutation for transpose. + * **prop** (*tf.Tensor*) – tensor with shape [1, n, …] + * **index** (*tf.Tensor*) – integer tensor with shape [1, n] + * **perm** (*list*) – permutation for transpose. ## *class* maml.models.WeightedSet2Set(\*args, \*\*kwargs) @@ -189,7 +148,7 @@ Here, in addition to taking features and indices as inputs, we also take a weight tensor. The input to the core logic is [features, weights, indices]. -### _lstm(h, c) +### \_lstm(h, c) ### build(input_shape: Sequence) @@ -201,13 +160,9 @@ Build the output shape from input shapes Core logic of the layer. - * **Parameters** - - * **inputs** (*tuple*) – input tuple of length 3 - - - * **mask** (*tf.Tensor*) – not used here + * **inputs** (*tuple*) – input tuple of length 3 + * **mask** (*tf.Tensor*) – not used here ### compute_output_shape(input_shape) @@ -220,156 +175,57 @@ Returns: sequence of tuples output shapes ### get_config() > Part of keras layer interface, where the signature is converted into a dict - - * **Returns** -configurational dictionary. + configurational dictionary. ## Subpackages - * [maml.models.dl package](maml.models.dl.md) - - + * `AtomSets` + * `AtomSets._get_data_generator()` + * `AtomSets._predict()` + * `AtomSets.evaluate()` + * `AtomSets.fit()` + * `AtomSets.from_dir()` + * `AtomSets.save()` + * `MLP` + * `WeightedAverageLayer` + * `WeightedAverageLayer.build()` + * `WeightedAverageLayer.call()` + * `WeightedAverageLayer.compute_output_shape()` + * `WeightedAverageLayer.get_config()` + * `WeightedAverageLayer.reduce_sum()` + * `WeightedSet2Set` + * `WeightedSet2Set._lstm()` + * `WeightedSet2Set.build()` + * `WeightedSet2Set.call()` + * `WeightedSet2Set.compute_output_shape()` + * `WeightedSet2Set.get_config()` + * maml.models.dl._atomsets module * `AtomSets` - - - * `AtomSets._get_data_generator()` - - - * `AtomSets._predict()` - - - * `AtomSets.evaluate()` - - - * `AtomSets.fit()` - - - * `AtomSets.from_dir()` - - - * `AtomSets.save()` - - - * `MLP` - - + * `AtomSets._get_data_generator()` + * `AtomSets._predict()` + * `AtomSets.evaluate()` + * `AtomSets.fit()` + * `AtomSets.from_dir()` + * `AtomSets.save()` + * `construct_atom_sets()` + * maml.models.dl._keras_utils module + * `deserialize_keras_activation()` + * `deserialize_keras_optimizer()` + * maml.models.dl._layers module * `WeightedAverageLayer` - - - * `WeightedAverageLayer.build()` - - - * `WeightedAverageLayer.call()` - - - * `WeightedAverageLayer.compute_output_shape()` - - - * `WeightedAverageLayer.get_config()` - - - * `WeightedAverageLayer.reduce_sum()` - - + * `WeightedAverageLayer.build()` + * `WeightedAverageLayer.call()` + * `WeightedAverageLayer.compute_output_shape()` + * `WeightedAverageLayer.get_config()` + * `WeightedAverageLayer.reduce_sum()` * `WeightedSet2Set` - - - * `WeightedSet2Set._lstm()` - - - * `WeightedSet2Set.build()` - - - * `WeightedSet2Set.call()` - - - * `WeightedSet2Set.compute_output_shape()` - - - * `WeightedSet2Set.get_config()` - - - * maml.models.dl._atomsets module - - - * `AtomSets` - - - * `AtomSets._get_data_generator()` - - - * `AtomSets._predict()` - - - * `AtomSets.evaluate()` - - - * `AtomSets.fit()` - - - * `AtomSets.from_dir()` - - - * `AtomSets.save()` - - - * `construct_atom_sets()` - - - * maml.models.dl._keras_utils module - - - * `deserialize_keras_activation()` - - - * `deserialize_keras_optimizer()` - - - * maml.models.dl._layers module - - - * `WeightedAverageLayer` - - - * `WeightedAverageLayer.build()` - - - * `WeightedAverageLayer.call()` - - - * `WeightedAverageLayer.compute_output_shape()` - - - * `WeightedAverageLayer.get_config()` - - - * `WeightedAverageLayer.reduce_sum()` - - - * `WeightedSet2Set` - - - * `WeightedSet2Set._lstm()` - - - * `WeightedSet2Set.build()` - - - * `WeightedSet2Set.call()` - - - * `WeightedSet2Set.compute_output_shape()` - - - * `WeightedSet2Set.get_config()` - - - * maml.models.dl._mlp module - - - * `MLP` - - - * `construct_mlp()` \ No newline at end of file + * `WeightedSet2Set._lstm()` + * `WeightedSet2Set.build()` + * `WeightedSet2Set.call()` + * `WeightedSet2Set.compute_output_shape()` + * `WeightedSet2Set.get_config()` + * maml.models.dl._mlp module + * `MLP` + * `construct_mlp()` \ No newline at end of file diff --git a/docs/maml.sampling.md b/docs/maml.sampling.md index 6ac40ef9..5bd9ffc2 100644 --- a/docs/maml.sampling.md +++ b/docs/maml.sampling.md @@ -54,18 +54,13 @@ Wrapper around selection of K data from each cluster. Fit the model. - * **Parameters** - - * **X** – Input features - - - * **y** – Target. + * **X** – Input features + * **y** – Target. #### transform(clustering_data: dict) Perform clustering. - * **Parameters** -**clustering_data** – Data to cluster. \ No newline at end of file + **clustering_data** – Data to cluster. \ No newline at end of file diff --git a/docs/maml.utils.md b/docs/maml.utils.md index fd9ca6da..1e5abfe0 100644 --- a/docs/maml.utils.md +++ b/docs/maml.utils.md @@ -29,9 +29,8 @@ Data splitter base class. Split the mat_ids, optionally one can provide targets. This is useful in stratified split. - * **Parameters** -**mat_ids** (*list*) – list of material ids + **mat_ids** (*list*) – list of material ids Returns: (train_ids, val_ids, test_ids) or @@ -47,16 +46,10 @@ Dummy scaler does nothing. ### *classmethod* from_training_data(structures: list[StructureOrMolecule], targets: VectorLike, is_intensive: bool = True) - * **Parameters** - - * **structures** (*list*) – list of structures/molecules - - - * **targets** (*list*) – vector of target properties - - - * **is_intensive** (*bool*) – whether the target is intensive + * **structures** (*list*) – list of structures/molecules + * **targets** (*list*) – vector of target properties + * **is_intensive** (*bool*) – whether the target is intensive Returns: DummyScaler. @@ -68,23 +61,16 @@ return as it is :param n: number of atoms :type n: int - * **Returns** -transformed_target. + transformed_target. ### *static* transform(target: float, n: int = 1) - * **Parameters** - - * **target** (*float*) – target numerical value - - - * **n** (*int*) – number of atoms - - + * **target** (*float*) – target numerical value + * **n** (*int*) – number of atoms * **Returns** -target. + target. ## *class* maml.utils.LinearProfile(value_start: float, value_end: float = 0.0, max_steps: int = 100, \*\*kwargs) @@ -110,22 +96,11 @@ and monty ScratchDir is that multiple temp directories are created here. It enables the running of multiple jobs simultaneously in the directories The way it works is as follows: - 1. Create multiple temp dirs in specified root path. - - 2. Optionally copy input files from current directory to temp dir. - - 3. User loops among all directories - - 4. User performs specified operations in each directories - - 5. Change back to original directory. - - 6. Delete temp dir. ### SCR_LINK(_ = ‘scratch_link_ ) @@ -147,9 +122,8 @@ Inverse transform of the target :param n: number of atoms :type n: int - * **Returns** -target. + target. ### transform(target: float, n: int = 1) @@ -159,9 +133,8 @@ Transform the target values into new target values :param n: number of atoms :type n: int - * **Returns** -scaled target. + scaled target. ## *class* maml.utils.ShuffleSplitter(ratios: str = ‘80/10/10’, delim: str = ‘/’, random_seed: int | None = None) @@ -213,9 +186,8 @@ Inverse transform of the target :param n: number of atoms :type n: int - * **Returns** -original target. + original target. ### transform(target: float, n: int = 1) @@ -225,9 +197,8 @@ Transform numeric values according the mean and std, plus a factor n :param n: number of atoms :type n: int - * **Returns** -scaled target. + scaled target. ## *class* maml.utils.Stats() @@ -246,13 +217,9 @@ supported Weighted average. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: average value @@ -260,13 +227,9 @@ Returns: average value Geometric mean of the data. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: geometric mean of the distribution @@ -274,13 +237,9 @@ Returns: geometric mean of the distribution harmonic mean of the data. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: harmonic mean of the distribution @@ -288,13 +247,9 @@ Returns: harmonic mean of the distribution inverse mean. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: average value @@ -302,13 +257,9 @@ Returns: average value Kurtosis of the distribution. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: Kurtosis of the distribution @@ -326,13 +277,9 @@ Returns: maximum value Weighted average. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: average value @@ -340,13 +287,9 @@ Returns: average value mean absolute deviation. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*) – optional weights + * **data** (*list*) – list of float data + * **weights** (*list*) – optional weights Returns: mean absolute deviation @@ -354,13 +297,9 @@ Returns: mean absolute deviation mean absolute error. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*) – optional weights + * **data** (*list*) – list of float data + * **weights** (*list*) – optional weights Returns: mean absolute error @@ -379,13 +318,9 @@ Returns: minimum value Mode of data, if multiple entries have equal counts, compute the average of those. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*) – optional weights + * **data** (*list*) – list of float data + * **weights** (*list*) – optional weights Returns: mode of values, i.e., max - min @@ -398,20 +333,11 @@ order = 2 means standard deviation order > 2 corresponds to higher order moment to > the 1./order power - - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data points - - - * **order** (*int*) – moment order - - - * **max_order** (*int*) – if set, it will overwrite order + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data points + * **order** (*int*) – moment order + * **max_order** (*int*) – if set, it will overwrite order Returns: float or list of floats @@ -419,16 +345,10 @@ Returns: float or list of floats power mean [https://en.wikipedia.org/wiki/Generalized_mean](https://en.wikipedia.org/wiki/Generalized_mean). - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point - - - * **p** (*int*) – power + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point + * **p** (*int*) – power Returns: power mean of the distribution @@ -448,16 +368,10 @@ Since we cannot calculate the geometric means on negative or zero values, we can first shift all values to positive and then calculate the geometric mean afterwards, we shift the computed geometric mean back by a shift value. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point - - - * **shift** (*float*) – shift value + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point + * **shift** (*float*) – shift value Returns: geometric mean of the distribution @@ -465,13 +379,9 @@ Returns: geometric mean of the distribution Skewness of the distribution. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: Skewness of the distribution @@ -479,13 +389,9 @@ Returns: Skewness of the distribution Standard deviation. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: Standard deviation @@ -522,24 +428,14 @@ and the corresponding forces and structures to lammps format The lattice are formed by the row vectors. - * **Parameters** - - * **structures** (*list*) – list of structures - - - * **forces** (*list*) – list of force matrixs (m, 3) - - - * **stresses** (*list*) – list of stress vectors - - - * **stress_format** (*str*) – stress format, choose from -“VASP”, “LAMMPS”, “SNAP” - - - * **return_none** (*bool*) – whether to return list of None -for forces and stresses + * **structures** (*list*) – list of structures + * **forces** (*list*) – list of force matrixs (m, 3) + * **stresses** (*list*) – list of stress vectors + * **stress_format** (*str*) – stress format, choose from + “VASP”, “LAMMPS”, “SNAP” + * **return_none** (*bool*) – whether to return list of None + for forces and stresses Returns: structures [forces], [stresses] @@ -548,24 +444,16 @@ Returns: structures [forces], [stresses] Method to convert a list of docs into objects, e.g., Structure and DataFrame. - * **Parameters** - - * **docs** (*[**dict**]*) – List of docs. Each doc should have the same -format as one returned from .dft.parse_dir. - - - * **include_stress** (*bool*) – Whether to include stress components. - - - * **\*\*kwargs** – Passthrough. - - + * **docs** (*[**dict**]*) – List of docs. Each doc should have the same + format as one returned from .dft.parse_dir. + * **include_stress** (*bool*) – Whether to include stress components. + * **\*\*kwargs** – Passthrough. * **Returns** -A list of structures, and a DataFrame with energy and force -data in ‘y_orig’ column, data type (‘energy’ or ‘force’) in -‘dtype’ column, No. of atoms in ‘n’ column sharing the same row -of energy data while ‘n’ being 1 for the rows of force data. + A list of structures, and a DataFrame with energy and force + data in ‘y_orig’ column, data type (‘energy’ or ‘force’) in + ‘dtype’ column, No. of atoms in ‘n’ column sharing the same row + of energy data while ‘n’ being 1 for the rows of force data. ## maml.utils.cwt(z: np.ndarray, widths: np.ndarray, wavelet: str | Callable = ‘morlet2’, \*\*kwargs) @@ -583,9 +471,8 @@ Returns: 2D scalogram. Get feature size from a test system. - * **Parameters** -**describer** (*BaseDescriber*) – describers instance + **describer** (*BaseDescriber*) – describers instance ## maml.utils.fft_magnitude(z: ndarray) @@ -601,26 +488,23 @@ Returns: 1D magnitude. For a describers, get a dummy object for transform_one. This relies on the type hint. - * **Parameters** -**instance** (*BaseDescriber*) – describers instance + **instance** (*BaseDescriber*) – describers instance ## maml.utils.get_full_args(func: Callable) Get args from function. - * **Parameters** -**func** (*callable*) – function to determine the args + **func** (*callable*) – function to determine the args ## maml.utils.get_full_stats_and_funcs(stats: list) Get expanded stats function name str and the corresponding function callables. - * **Parameters** -**stats** (*list*) – a list of stats names, e.g, [‘mean’, ‘std’, ‘moment:1:None’] + **stats** (*list*) – a list of stats names, e.g, [‘mean’, ‘std’, ‘moment:1:None’] Returns: list of stats names, list of stats callable @@ -629,13 +513,9 @@ Returns: list of stats names, list of stats callable Transform structure to lammps compatible structure. The lattice and rotation matrix are returned. - * **Parameters** - - * **structure** (*Structure*) – pymatgen structure - - - * **origin** (*tuple*) – origin coordinates + * **structure** (*Structure*) – pymatgen structure + * **origin** (*tuple*) – origin coordinates Returns: new lattice, rotation symmetry operator, rotation matrix @@ -660,27 +540,17 @@ Returns: decorated function Method to convert structures and their properties in to datapool format. - * **Parameters** - - * **structures** (*[**Structure**]*) – The list of Pymatgen Structure object. - - - * **energies** (*[**float**]*) – The list of total energies of each structure -in structures list. - - - * **forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure -with m atoms in structures list. m can be varied with each -single structure case. - - - * **stresses** (*list*) – List of (6, ) virial stresses of each -structure in structures list. - - + * **structures** (*[**Structure**]*) – The list of Pymatgen Structure object. + * **energies** (*[**float**]*) – The list of total energies of each structure + in structures list. + * **forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure + with m atoms in structures list. m can be varied with each + single structure case. + * **stresses** (*list*) – List of (6, ) virial stresses of each + structure in structures list. * **Returns** -([dict]) + ([dict]) ## maml.utils.spectrogram(z: np.ndarray, return_time_freq: bool = False) @@ -698,9 +568,8 @@ Convert a list of stats str into a fully expanded list. This applies mainly to stats that can return a list of values, e.g., moment with max_order > 1. - * **Parameters** -**stats_list** (*list*) – list of stats str + **stats_list** (*list*) – list of stats str Returns: list of expanded stats str @@ -720,16 +589,12 @@ Returns: list of float stress vector convert a length-6 stress list to stress matrix 3x3. - * **Parameters** - - * **stress** (*list*\* of \**float*) – list of stress - - - * **stress_format** (*str*) – Supported formats are the follows -VASP: xx, yy, zz, xy, yz, xz -LAMMPS: xx, yy, zz, xy, zx, yz -SNAP: xx, yy, zz, yz, xz, xy + * **stress** (*list*\* of \**float*) – list of stress + * **stress_format** (*str*) – Supported formats are the follows + VASP: xx, yy, zz, xy, yz, xz + LAMMPS: xx, yy, zz, xy, zx, yz + SNAP: xx, yy, zz, yz, xz, xy Returns: 3x3 stress matrix @@ -754,13 +619,10 @@ return np.ndarray. Convert str/structure or composition to compositions. - * **Parameters** -**obj** (*str/structure/composition*) – object to convert - - + **obj** (*str/structure/composition*) – object to convert * **Returns** -Composition object + Composition object ## maml.utils.write_data_from_structure(structure: Structure, filename: str, ff_elements: list[str] | None = None, significant_figures: int = 6, origin: tuple = (0, 0, 0)) @@ -797,24 +659,16 @@ Convert data list to docs or pool existing data lists for training. Method to convert a list of docs into objects, e.g., Structure and DataFrame. - * **Parameters** - - * **docs** (*[**dict**]*) – List of docs. Each doc should have the same -format as one returned from .dft.parse_dir. - - - * **include_stress** (*bool*) – Whether to include stress components. - - - * **\*\*kwargs** – Passthrough. - - + * **docs** (*[**dict**]*) – List of docs. Each doc should have the same + format as one returned from .dft.parse_dir. + * **include_stress** (*bool*) – Whether to include stress components. + * **\*\*kwargs** – Passthrough. * **Returns** -A list of structures, and a DataFrame with energy and force -data in ‘y_orig’ column, data type (‘energy’ or ‘force’) in -‘dtype’ column, No. of atoms in ‘n’ column sharing the same row -of energy data while ‘n’ being 1 for the rows of force data. + A list of structures, and a DataFrame with energy and force + data in ‘y_orig’ column, data type (‘energy’ or ‘force’) in + ‘dtype’ column, No. of atoms in ‘n’ column sharing the same row + of energy data while ‘n’ being 1 for the rows of force data. ### maml.utils._data_conversion.doc_from(structure, energy=None, force=None, stress=None) @@ -822,52 +676,32 @@ Method to convert structure and its properties into doc format for further processing. If properties are None, zeros array will be used. - * **Parameters** - - * **structure** (*Structure*) – Pymatgen Structure object. - - - * **energy** (*float*) – The total energy of the structure. - - - * **force** (*np.array*) – The (m, 3) forces array of the structure -where m is the number of atoms in structure. - - - * **stress** (*list/np.array*) – The (6, ) stresses array of the -structure. - - + * **structure** (*Structure*) – Pymatgen Structure object. + * **energy** (*float*) – The total energy of the structure. + * **force** (*np.array*) – The (m, 3) forces array of the structure + where m is the number of atoms in structure. + * **stress** (*list/np.array*) – The (6, ) stresses array of the + structure. * **Returns** -(dict) + (dict) ### maml.utils._data_conversion.pool_from(structures, energies=None, forces=None, stresses=None) Method to convert structures and their properties in to datapool format. - * **Parameters** - - * **structures** (*[**Structure**]*) – The list of Pymatgen Structure object. - - - * **energies** (*[**float**]*) – The list of total energies of each structure -in structures list. - - - * **forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure -with m atoms in structures list. m can be varied with each -single structure case. - - - * **stresses** (*list*) – List of (6, ) virial stresses of each -structure in structures list. - - + * **structures** (*[**Structure**]*) – The list of Pymatgen Structure object. + * **energies** (*[**float**]*) – The list of total energies of each structure + in structures list. + * **forces** (*[**np.array**]*) – List of (m, 3) forces array of each structure + with m atoms in structures list. m can be varied with each + single structure case. + * **stresses** (*list*) – List of (6, ) virial stresses of each + structure in structures list. * **Returns** -([dict]) + ([dict]) ### maml.utils._data_conversion.to_array(x) @@ -891,9 +725,8 @@ Data splitter base class. Split the mat_ids, optionally one can provide targets. This is useful in stratified split. - * **Parameters** -**mat_ids** (*list*) – list of material ids + **mat_ids** (*list*) – list of material ids Returns: (train_ids, val_ids, test_ids) or @@ -924,18 +757,16 @@ Dummy test systems. Get feature size from a test system. - * **Parameters** -**describer** (*BaseDescriber*) – describers instance + **describer** (*BaseDescriber*) – describers instance ### maml.utils._dummy.get_describer_dummy_obj(instance) For a describers, get a dummy object for transform_one. This relies on the type hint. - * **Parameters** -**instance** (*BaseDescriber*) – describers instance + **instance** (*BaseDescriber*) – describers instance ## maml.utils._inspect module @@ -945,17 +776,15 @@ Inspect function args. Get args from function. - * **Parameters** -**func** (*callable*) – function to determine the args + **func** (*callable*) – function to determine the args ### maml.utils._inspect.get_param_types(func) Get param and type info. - * **Parameters** -**func** (*callable*) – function to determine the arg types + **func** (*callable*) – function to determine the arg types ## maml.utils._jit module @@ -978,9 +807,8 @@ LAMMPS utility. Get atomic mass from element or specie string. - * **Parameters** -**element_or_specie** (*str*) – specie or element string + **element_or_specie** (*str*) – specie or element string Returns: float mass @@ -988,9 +816,8 @@ Returns: float mass Get charge from element or specie. - * **Parameters** -**element_or_specie** (*str*\* or **Element** or \**Species*) – element or specie + **element_or_specie** (*str*\* or **Element** or \**Species*) – element or specie Returns: charge float @@ -1005,24 +832,14 @@ and the corresponding forces and structures to lammps format The lattice are formed by the row vectors. - * **Parameters** - - * **structures** (*list*) – list of structures - - - * **forces** (*list*) – list of force matrixs (m, 3) - - - * **stresses** (*list*) – list of stress vectors - - - * **stress_format** (*str*) – stress format, choose from -“VASP”, “LAMMPS”, “SNAP” - - - * **return_none** (*bool*) – whether to return list of None -for forces and stresses + * **structures** (*list*) – list of structures + * **forces** (*list*) – list of force matrixs (m, 3) + * **stresses** (*list*) – list of stress vectors + * **stress_format** (*str*) – stress format, choose from + “VASP”, “LAMMPS”, “SNAP” + * **return_none** (*bool*) – whether to return list of None + for forces and stresses Returns: structures [forces], [stresses] @@ -1031,13 +848,9 @@ Returns: structures [forces], [stresses] Transform structure to lammps compatible structure. The lattice and rotation matrix are returned. - * **Parameters** - - * **structure** (*Structure*) – pymatgen structure - - - * **origin** (*tuple*) – origin coordinates + * **structure** (*Structure*) – pymatgen structure + * **origin** (*tuple*) – origin coordinates Returns: new lattice, rotation symmetry operator, rotation matrix @@ -1057,16 +870,12 @@ Returns: list of float stress vector convert a length-6 stress list to stress matrix 3x3. - * **Parameters** - - * **stress** (*list*\* of \**float*) – list of stress - - - * **stress_format** (*str*) – Supported formats are the follows -VASP: xx, yy, zz, xy, yz, xz -LAMMPS: xx, yy, zz, xy, zx, yz -SNAP: xx, yy, zz, yz, xz, xy + * **stress** (*list*\* of \**float*) – list of stress + * **stress_format** (*str*) – Supported formats are the follows + VASP: xx, yy, zz, xy, yz, xz + LAMMPS: xx, yy, zz, xy, zx, yz + SNAP: xx, yy, zz, yz, xz, xy Returns: 3x3 stress matrix @@ -1103,13 +912,10 @@ Materials utils. Convert str/structure or composition to compositions. - * **Parameters** -**obj** (*str/structure/composition*) – object to convert - - + **obj** (*str/structure/composition*) – object to convert * **Returns** -Composition object + Composition object ## maml.utils._preprocessing module @@ -1123,16 +929,10 @@ Dummy scaler does nothing. #### *classmethod* from_training_data(structures: list[StructureOrMolecule], targets: VectorLike, is_intensive: bool = True) - * **Parameters** - - * **structures** (*list*) – list of structures/molecules - - - * **targets** (*list*) – vector of target properties - - - * **is_intensive** (*bool*) – whether the target is intensive + * **structures** (*list*) – list of structures/molecules + * **targets** (*list*) – vector of target properties + * **is_intensive** (*bool*) – whether the target is intensive Returns: DummyScaler. @@ -1144,23 +944,16 @@ return as it is :param n: number of atoms :type n: int - * **Returns** -transformed_target. + transformed_target. #### *static* transform(target: float, n: int = 1) - * **Parameters** - - * **target** (*float*) – target numerical value - - - * **n** (*int*) – number of atoms - - + * **target** (*float*) – target numerical value + * **n** (*int*) – number of atoms * **Returns** -target. + target. ### *class* maml.utils._preprocessing.Scaler() @@ -1179,9 +972,8 @@ Inverse transform of the target :param n: number of atoms :type n: int - * **Returns** -target. + target. #### transform(target: float, n: int = 1) @@ -1191,9 +983,8 @@ Transform the target values into new target values :param n: number of atoms :type n: int - * **Returns** -scaled target. + scaled target. ### *class* maml.utils._preprocessing.StandardScaler(mean: float = 0.0, std: float = 1.0, is_intensive: bool = True) @@ -1230,9 +1021,8 @@ Inverse transform of the target :param n: number of atoms :type n: int - * **Returns** -original target. + original target. #### transform(target: float, n: int = 1) @@ -1242,9 +1032,8 @@ Transform numeric values according the mean and std, plus a factor n :param n: number of atoms :type n: int - * **Returns** -scaled target. + scaled target. ## maml.utils._signal_processing module @@ -1321,13 +1110,9 @@ supported Weighted average. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: average value @@ -1335,13 +1120,9 @@ Returns: average value Geometric mean of the data. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: geometric mean of the distribution @@ -1349,13 +1130,9 @@ Returns: geometric mean of the distribution harmonic mean of the data. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: harmonic mean of the distribution @@ -1363,13 +1140,9 @@ Returns: harmonic mean of the distribution inverse mean. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: average value @@ -1377,13 +1150,9 @@ Returns: average value Kurtosis of the distribution. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: Kurtosis of the distribution @@ -1401,13 +1170,9 @@ Returns: maximum value Weighted average. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: average value @@ -1415,13 +1180,9 @@ Returns: average value mean absolute deviation. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*) – optional weights + * **data** (*list*) – list of float data + * **weights** (*list*) – optional weights Returns: mean absolute deviation @@ -1429,13 +1190,9 @@ Returns: mean absolute deviation mean absolute error. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*) – optional weights + * **data** (*list*) – list of float data + * **weights** (*list*) – optional weights Returns: mean absolute error @@ -1454,13 +1211,9 @@ Returns: minimum value Mode of data, if multiple entries have equal counts, compute the average of those. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*) – optional weights + * **data** (*list*) – list of float data + * **weights** (*list*) – optional weights Returns: mode of values, i.e., max - min @@ -1473,20 +1226,11 @@ order = 2 means standard deviation order > 2 corresponds to higher order moment to > the 1./order power - - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data points - - - * **order** (*int*) – moment order - - - * **max_order** (*int*) – if set, it will overwrite order + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data points + * **order** (*int*) – moment order + * **max_order** (*int*) – if set, it will overwrite order Returns: float or list of floats @@ -1494,16 +1238,10 @@ Returns: float or list of floats power mean [https://en.wikipedia.org/wiki/Generalized_mean](https://en.wikipedia.org/wiki/Generalized_mean). - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point - - - * **p** (*int*) – power + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point + * **p** (*int*) – power Returns: power mean of the distribution @@ -1523,16 +1261,10 @@ Since we cannot calculate the geometric means on negative or zero values, we can first shift all values to positive and then calculate the geometric mean afterwards, we shift the computed geometric mean back by a shift value. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point - - - * **shift** (*float*) – shift value + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point + * **shift** (*float*) – shift value Returns: geometric mean of the distribution @@ -1540,13 +1272,9 @@ Returns: geometric mean of the distribution Skewness of the distribution. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: Skewness of the distribution @@ -1554,13 +1282,9 @@ Returns: Skewness of the distribution Standard deviation. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point Returns: Standard deviation @@ -1568,9 +1292,8 @@ Returns: Standard deviation Decorate to add allowed_stats to the Stats class. - * **Parameters** -**cls** – Stats class + **cls** – Stats class Returns: Stats class with allowed_stats attributes @@ -1582,16 +1305,10 @@ Returns: Stats class with allowed_stats attributes Auxiliary function to compute moment. - * **Parameters** - - * **data** (*list*) – list of float data - - - * **weights** (*list*\* or \**None*) – weights for each data point - - - * **order** (*int*) – order of moment + * **data** (*list*) – list of float data + * **weights** (*list*\* or \**None*) – weights for each data point + * **order** (*int*) – order of moment Returns: moment of order @@ -1600,9 +1317,8 @@ Returns: moment of order Get expanded stats function name str and the corresponding function callables. - * **Parameters** -**stats** (*list*) – a list of stats names, e.g, [‘mean’, ‘std’, ‘moment:1:None’] + **stats** (*list*) – a list of stats names, e.g, [‘mean’, ‘std’, ‘moment:1:None’] Returns: list of stats names, list of stats callable @@ -1612,9 +1328,8 @@ Convert a list of stats str into a fully expanded list. This applies mainly to stats that can return a list of values, e.g., moment with max_order > 1. - * **Parameters** -**stats_list** (*list*) – list of stats str + **stats_list** (*list*) – list of stats str Returns: list of expanded stats str @@ -1634,22 +1349,11 @@ and monty ScratchDir is that multiple temp directories are created here. It enables the running of multiple jobs simultaneously in the directories The way it works is as follows: - 1. Create multiple temp dirs in specified root path. - - 2. Optionally copy input files from current directory to temp dir. - - 3. User loops among all directories - - 4. User performs specified operations in each directories - - 5. Change back to original directory. - - 6. Delete temp dir. #### SCR_LINK(_ = ‘scratch_link_ ) @@ -1662,13 +1366,9 @@ Implements a recursive copy function similar to Unix’s “cp -r” command. Surprisingly, python does not have a real equivalent. shutil.copytree only works if the destination directory is not present. - * **Parameters** - - * **src** (*str*) – Source folder to copy. - - - * **dst** (*str*) – Destination folder. + * **src** (*str*) – Source folder to copy. + * **dst** (*str*) – Destination folder. ## maml.utils._typing module diff --git a/pyproject.toml b/pyproject.toml index 4aaa0d2c..9a18a941 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,7 +73,7 @@ where = ["src"] line-length = 120 [tool.ruff] -target-version = "py38" +target-version = "2024.6.13" line-length = 120 lint.select = [ "B", # flake8-bugbear diff --git a/tasks.py b/tasks.py index 662ccbec..5f5a249a 100644 --- a/tasks.py +++ b/tasks.py @@ -28,7 +28,7 @@ def make_doc(ctx): with cd("docs"): ctx.run("rm maml.*.rst", warn=True) ctx.run("touch index.rst", warn=True) - ctx.run("sphinx-apidoc -P -M -d 6 -o . -f ../maml") + ctx.run("sphinx-apidoc -P -M -d 6 -o . -f ../src/maml") ctx.run("rm maml*.tests.*rst", warn=True) ctx.run("sphinx-build -M markdown . .") ctx.run("rm *.rst", warn=True)