glasspy.predict package
Submodules
glasspy.predict.base module
Module with base classes for building predictive models.
- class glasspy.predict.base.Domain(element: Dict[str, float] = None, compound: Dict[str, float] = None)
Bases:
NamedTupleSimple class to store chemical domain information.
- compound: Dict[str, float]
Alias for field number 1
- element: Dict[str, float]
Alias for field number 0
- class glasspy.predict.base.MLP(*args: Any, **kwargs: Any)
Bases:
LightningModule,PredictBase class for creating Multilayer Perceptrons.
- Parameters:
hparams –
Dictionary with the hyperparemeters of the network. The possible parameters are:
n_features: number of input features (required). Must be a positive integer.
num_layers: number of hidden layers (defaults to 1). Must be a positive integer.
layer_n_size: number of neurons in layer n (replace n for an integer starting at 1, defaults to 10). Must be a positive integer.
layer_n_activation: activation function of layer n (replace n for an integer starting at 1, defaults to Tanh). Available values are [“Tanh”, “Sigmoid”, “ReLU”, “LeakyReLU”, “SELU”, “GELU”, “ELU”, “PReLU”, “SiLU”, “Mish”, “Softplus”, “Linear”].
layer_n_dropout: dropout of layer n (replace n for an integer starting at 1, defaults to False meaning no dropout). Any value between 0 and 1 (or False) is permitted.
layer_n_batchnorm: True will use batch normalization in layer n, False will not use batch normalization in layer n (replace n for an integer starting at 1, defaults to False meaning no batch normalization).
loss: loss function to use for the backpropagation algorithm (defaults to mse). Use mse for mean squared error loss (L2) or huber for a smooth L1 loss.
optimizer: optimizer algorithm to use (defaults SGD). Use SGD for stochastic gradient descend, Adam for Adam, or AdamW for weighted Adam.
lr: optimizer learning rate (defaults to 1e-4 if optimizer is SGD or 1e-3 if optimizer is Adam or AdamW).
momentum: momentum to use when optmizer is SGD (defaults to 0).
optimizer_Adam_eps: eps to use for Adam or AdamW optimizers (defaults to 1e-8).
- Raises:
NotImplementedError – When the selected hyperparameters is not one of the permited values.
- configure_optimizers()
- distance_from_training()
- forward(x)
Method used for training the neural network.
Consider using other methods for prediction.
- Parameters:
x – Feature tensor.
- Returns
Tensor with the predictions.
- classmethod from_file(hparams_path, state_dict_path=None, learning_curve_path=None)
- get_test_dataset()
- get_training_dataset()
- is_within_domain()
- learning_curve_train = []
- learning_curve_val = []
- load_training(state_dict_path=None, learning_curve_path=None)
- on_train_epoch_end()
- on_validation_epoch_end()
- predict(x)
- save_training(state_dict_path=None, learning_curve_path=None, hparams_path=None)
- test_step(batch, batch_idx)
- training_step(batch, batch_idx)
- validation_step(batch, batch_idx)
- class glasspy.predict.base.MTL(*args: Any, **kwargs: Any)
Bases:
MLPBase class for creating Multitask Learning NN.
- Parameters:
hparams –
Dictionary with the hyperparemeters of the network. The possible parameters are:
n_features: number of input features (required). Must be a positive integer.
num_layers: number of hidden layers (defaults to 1). Must be a positive integer.
layer_n_size: number of neurons in layer n (replace n for an integer starting at 1, defaults to 10). Must be a positive integer.
layer_n_activation: activation function of layer n (replace n for an integer starting at 1, defaults to Tanh). Available values are [“Tanh”, “Sigmoid”, “ReLU”, “LeakyReLU”, “SELU”, “GELU”, “ELU”, “PReLU”, “SiLU”, “Mish”, “Softplus”, “Linear”].
layer_n_dropout: dropout of layer n (replace n for an integer starting at 1, defaults to False meaning no dropout). Any value between 0 and 1 (or False) is permitted.
layer_n_batchnorm: True will use batch normalization in layer n, False will not use batch normalization in layer n (replace n for an integer starting at 1, defaults to False meaning no batch normalization).
loss: loss function to use for the backpropagation algorithm (defaults to mse). Use mse for mean squared error loss (L2) or huber for a smooth L1 loss.
optimizer: optimizer algorithm to use (defaults SGD). Use SGD for stochastic gradient descend, Adam for Adam, or AdamW for weighted Adam.
lr: optimizer learning rate (defaults to 1e-4 if optimizer is SGD or 1e-3 if optimizer is Adam or AdamW).
momentum: momentum to use when optmizer is SGD (defaults to 0).
optimizer_Adam_eps: eps to use for Adam or AdamW optimizers (defaults to 1e-8).
num_neurons_per_head – Positive integer or None. The number of neurons for each head of the NN. If None, then the neural network will not have multi-head.
- Raises:
NotImplementedError – When the selected hyperparameters is not one of the permited values.
- forward_multihead(x)
Method used for training the neural network with multihead.
Consider using other methods for prediction.
- Parameters:
x – Feature tensor.
- Returns
Tensor with the predictions.
- classmethod from_file(hparams_path, state_dict_path=None, learning_curve_path=None, num_neurons_per_head=None)
- test_step(batch, batch_idx)
- training_step(batch, batch_idx)
- validation_step(batch, batch_idx)
- class glasspy.predict.base.Predict(**kwargs)
Bases:
ABCBase class for GlassPy predictors.
- static MAE(y_true: ndarray, y_pred: ndarray) float
Computes the mean absolute error.
- Parameters:
y_true – Array with the true values of y. Can be 1D or 2D.
y_pred – Aray with the predicted values of y. Can be 1D or 2D.
- Returns:
The mean absolute error. Will be 1D if the input arrays are 2D. Will be a scalar otherwise.
- static MSE(y_true: ndarray, y_pred: ndarray) float
Computes the mean squared error.
- Parameters:
y_true – Array with the true values of y. Can be 1D or 2D.
y_pred – Aray with the predicted values of y. Can be 1D or 2D.
- Returns:
The mean squared error. Will be 1D if the input arrays are 2D. Will be a scalar otherwise.
- static MedAE(y_true: ndarray, y_pred: ndarray) float
Computes the median absolute error.
- Parameters:
y_true – Array with the true values of y. Can be 1D or 2D.
y_pred – Aray with the predicted values of y. Can be 1D or 2D.
- Returns:
The median absolute error. Will be 1D if the input arrays are 2D. Will be a scalar otherwise.
- static PercAE(y_true: ndarray, y_pred: ndarray, q=75) float
Computes the percentile absolute error.
- Parameters:
y_true – Array with the true values of y. Can be 1D or 2D.
y_pred – Aray with the predicted values of y. Can be 1D or 2D.
q – Percentile to compute.
- Returns:
The percentile absolute error. Will be 1D if the input arrays are 2D. Will be a scalar otherwise.
- static R2(y_true: ndarray, y_pred: ndarray, one_param: bool = True) float
Computes the coefficient of determination.
- Parameters:
y_true – 1D array with the true values of y.
y_pred – 1D array with the predicted values of y.
one_param – Determines the relationship between y_true and y_pred. If ´True´ then it is a relationship with one parameter (y_true = y_pred * c_0 + error). If ´False´ then it is a relationship with two parameters (y_true = y_pred * c_0 + c_1 + error). In most of regression problems, the first case is desired.
- Returns:
The coefficient of determination.
- static RD(y_true: ndarray, y_pred: ndarray) float
Computes the relative deviation.
- Parameters:
y_true – 1D array with the true values of y.
y_pred – 1D array with the predicted values of y.
- Returns:
The relative deviation.
- static RMSE(y_true: ndarray, y_pred: ndarray) float
Computes the root mean squared error.
- Parameters:
y_true – Array with the true values of y. Can be 1D or 2D.
y_pred – Aray with the predicted values of y. Can be 1D or 2D.
- Returns:
The root mean squared error. Will be 1D if the input arrays are 2D. Will be a scalar otherwise.
- static RRMSE(y_true: ndarray, y_pred: ndarray) float
Computes the relative root mean squared error.
- Parameters:
y_true – 1D array with the true values of y.
y_pred – 1D array with the predicted values of y.
- Returns:
The relative root mean squared error.
- abstract property domain
- abstractmethod get_test_dataset()
- abstractmethod get_training_dataset()
- abstractmethod is_within_domain()
- abstractmethod predict()
glasspy.predict.models module
Predictive models offered by GlassPy.
- class glasspy.predict.models.GlassNet(*args: Any, **kwargs: Any)
Bases:
GlassNetMTMHHybrid neural network for predicting glass properties.
This hybrid model has a multitask neural network to compute most of the properties and especialized neural networks to predict selected properties.
- Parameters:
st_models – List of the properties to use especialized models instead of using the multitask network. If default, then the model uses those properties that performed better than the multitask model.
- predict(composition: str | List[float] | List[List[float]] | ndarray | Dict[str, float] | Dict[str, List[float]] | Dict[str, ndarray] | DataFrame | ChemArray, input_cols: List[str] = [], return_dataframe: bool = True)
Makes prediction of properties.
- Parameters:
composition – Any composition-like object.
input_cols – List of strings representing the chemical entities related to each column of composition. Necessary only when composition is a list or array, ignored otherwise.
return_dataframe – If True, then returns a pandas DataFrame, else returns an array. Default value is True.
- Returns:
Predicted values of properties. Will be a DataFrame if return_dataframe is True, otherwise will be an array.
- class glasspy.predict.models.GlassNetMTMH(*args: Any, **kwargs: Any)
Bases:
_BaseGlassNet,_BaseGlassNetViscosityMultitask neural network for predicting glass properties.
This is the MT-MH model.
- class glasspy.predict.models.GlassNetMTMLP(*args: Any, **kwargs: Any)
Bases:
_BaseGlassNet,_BaseGlassNetViscosityMultitask neural network for predicting glass properties.
This is the MT-MLP model.
- class glasspy.predict.models.GlassNetSTNN(*args: Any, **kwargs: Any)
Bases:
_BaseGlassNetSingle-task neural network for predicting glass properties.
This is the ST-NN model.
- test_step(batch, batch_idx)
- training_step(batch, batch_idx)
- validation_step(batch, batch_idx)
- class glasspy.predict.models.VITRIFY(model='CHEM', framework='onnx', calibrated=True)
Bases:
PredictPredictor of the probability of forming a glass using the VITRIFY model.
VITRIFY stands for Vitrification Inference Tool for Rapid Identification of glass-Forming abilitY.
The original model was trained using the scikit-learn framework. During conversion to ONNX, all float64 values were cast to float32. As a result, compositions very close to decision boundaries may yield different predictions due to floating-point rounding.
Warning
When using the sklearn framework, scikit-learn version 1.9.0 must be installed. Other versions may produce inconsistent results.
- Parameters:
model (str) – Name of the glass-formation predictive model to use. Available options are: FEATENG, or CHEM. Defaults to “CHEM”.
framework (str) – Inference framework to use. Accepted values are “onnx” and “sklearn”. Defaults to “onnx” if not specified. If “sklearn” is selected, ensure scikit-learn version 1.9.0 is installed.
calibrated (bool) – Wether to use the calibrated model (considering 5-fold cross-validation) or not. Defaults to True.
- static citation(bibtex: bool = False) str
- property domain
- get_test_dataset()
- get_training_dataset()
- is_within_domain()
- predict(composition: str | List[float] | List[List[float]] | ndarray | Dict[str, float] | Dict[str, List[float]] | Dict[str, ndarray] | DataFrame | ChemArray, input_cols: List[str] = [], thres=None)
Classifies the compositions with respect of glass formation.
- Parameters:
composition – Any composition like object.
input_cols – List of strings representing the chemical entities related to each column of composition. Necessary only when composition is a list or array, ignored otherwise.
thres – change the decision threshold to predict the positive class (ie, forms glass). None means default threshold of 0.5. Defaults to None.
- Returns:
Array with zeros and ones. Zero represent a prediction that the composition will not form a glass while one represents the opposite.
- predict_proba(composition: str | List[float] | List[List[float]] | ndarray | Dict[str, float] | Dict[str, List[float]] | Dict[str, ndarray] | DataFrame | ChemArray, input_cols: List[str] = [])
Returns the predicted probabilities of the model.
- Parameters:
composition – Any composition like object.
input_cols – List of strings representing the chemical entities related to each column of composition. Necessary only when composition is a list or array, ignored otherwise.
- Returns:
2D Numpy array with values between 0 and 1. First column represents the probability of not forming a glass and second column represents the probability of forming a glass.
- predict_proba_glass(composition: str | List[float] | List[List[float]] | ndarray | Dict[str, float] | Dict[str, List[float]] | Dict[str, ndarray] | DataFrame | ChemArray, input_cols: List[str] = [])
Returns the predicted probability of forming a glass.
- Parameters:
composition – Any composition like object.
input_cols – List of strings representing the chemical entities related to each column of composition. Necessary only when composition is a list or array, ignored otherwise.
- Returns:
Numpy array with values between 0 and 1 representing the predicted probability of glass formation.
- class glasspy.predict.models.ViscNet(*args: Any, **kwargs: Any)
Bases:
_BaseViscNetViscNet predictor of viscosity and viscosity parameters.
ViscNet is a physics-informed neural network that has the MYEGA [1] viscosity equation embedded in it. See Ref. [2] for the original publication.
References
- [1] J.C. Mauro, Y. Yue, A.J. Ellison, P.K. Gupta, D.C. Allan, Viscosity of
glass-forming liquids., Proceedings of the National Academy of Sciences of the United States of America. 106 (2009) 19780–19784. https://doi.org/10.1073/pnas.0911705106.
- [2] D.R. Cassar, ViscNet: Neural network for predicting the fragility
index and the temperature-dependency of viscosity, Acta Materialia. 206 (2021) 116602. https://doi.org/10.1016/j.actamat.2020.116602. https://arxiv.org/abs/2007.03719
- absolute_features = [('ElectronAffinity', 'std1'), ('FusionEnthalpy', 'std1'), ('GSenergy_pa', 'std1'), ('GSmagmom', 'std1'), ('NdUnfilled', 'std1'), ('NfValence', 'std1'), ('NpUnfilled', 'std1'), ('atomic_radius_rahm', 'std1'), ('c6_gb', 'std1'), ('lattice_constant', 'std1'), ('mendeleev_number', 'std1'), ('num_oxistates', 'std1'), ('nvalence', 'std1'), ('vdw_radius_alvarez', 'std1'), ('vdw_radius_uff', 'std1'), ('zeff', 'std1')]
- featurizer(composition: str | List[float] | List[List[float]] | ndarray | Dict[str, float] | Dict[str, List[float]] | Dict[str, ndarray] | DataFrame | ChemArray, input_cols: List[str] = []) ndarray
Compute the chemical features used for viscosity prediction.
- Parameters:
composition – Any composition like object.
input_cols – List of strings representing the chemical entities related to each column of composition. Necessary only when composition is a list or array, ignored otherwise.
- Returns:
Array with the computed chemical features
- log_viscosity_fun(T, log_eta_inf, Tg, m)
Computes the base-10 logarithm of viscosity using the MYEGA equation.
- parameters_range = {'Tg': [400, 1400], 'log_eta_inf': [-18, 5], 'm': [10, 130]}
- weighted_features = [('FusionEnthalpy', 'min'), ('GSbandgap', 'max'), ('GSmagmom', 'mean'), ('GSvolume_pa', 'max'), ('MiracleRadius', 'std1'), ('NValence', 'max'), ('NValence', 'min'), ('NdUnfilled', 'max'), ('NdValence', 'max'), ('NsUnfilled', 'max'), ('SpaceGroupNumber', 'max'), ('SpaceGroupNumber', 'min'), ('atomic_radius', 'max'), ('atomic_volume', 'max'), ('c6_gb', 'max'), ('c6_gb', 'min'), ('max_ionenergy', 'min'), ('num_oxistates', 'max'), ('nvalence', 'min')]
- class glasspy.predict.models.ViscNetHuber(*args: Any, **kwargs: Any)
Bases:
ViscNetViscNet-Huber predictor of viscosity and viscosity parameters.
ViscNet-Huber is a physics-informed neural network that has the MYEGA [1] viscosity equation embedded in it. The difference between this model and ViscNet is the loss function: this model has a robust smooth-L1 loss function, while ViscNet has a MSE (L2) loss function. See Ref. [2] for the original publication.
References
- [1] J.C. Mauro, Y. Yue, A.J. Ellison, P.K. Gupta, D.C. Allan, Viscosity of
glass-forming liquids., Proceedings of the National Academy of Sciences of the United States of America. 106 (2009) 19780–19784. https://doi.org/10.1073/pnas.0911705106.
- [2] D.R. Cassar, ViscNet: Neural network for predicting the fragility
index and the temperature-dependency of viscosity, Acta Materialia. 206 (2021) 116602. https://doi.org/10.1016/j.actamat.2020.116602. https://arxiv.org/abs/2007.03719
- class glasspy.predict.models.ViscNetVFT(*args: Any, **kwargs: Any)
Bases:
ViscNetViscNet-VFT predictor of viscosity and viscosity parameters.
ViscNet-VFT is a physics-informed neural network that has the VFT [1-3] viscosity equation embedded in it. See Ref. [4] for the original publication.
References
- [1] H. Vogel, Das Temperatureabhängigketsgesetz der Viskosität von
Flüssigkeiten, Physikalische Zeitschrift. 22 (1921) 645–646.
- [2] G.S. Fulcher, Analysis of recent measurements of the viscosity of
glasses, Journal of the American Ceramic Society. 8 (1925) 339–355. https://doi.org/10.1111/j.1151-2916.1925.tb16731.x.
- [3] G. Tammann, W. Hesse, Die Abhängigkeit der Viscosität von der
Temperatur bie unterkühlten Flüssigkeiten, Z. Anorg. Allg. Chem. 156 (1926) 245–257. https://doi.org/10.1002/zaac.19261560121.
- [4] D.R. Cassar, ViscNet: Neural network for predicting the fragility
index and the temperature-dependency of viscosity, Acta Materialia. 206 (2021) 116602. https://doi.org/10.1016/j.actamat.2020.116602. https://arxiv.org/abs/2007.03719
- log_viscosity_fun(T, log_eta_inf, Tg, m)
Computes the base-10 logarithm of viscosity using the VFT equation.
- Reference:
- [1] H. Vogel, Das Temperatureabhängigketsgesetz der Viskosität von
Flüssigkeiten, Physikalische Zeitschrift. 22 (1921) 645–646.
- [2] G.S. Fulcher, Analysis of recent measurements of the viscosity of
glasses, Journal of the American Ceramic Society. 8 (1925) 339–355. https://doi.org/10.1111/j.1151-2916.1925.tb16731.x.
- [3] G. Tammann, W. Hesse, Die Abhängigkeit der Viscosität von der
Temperatur bie unterkühlten Flüssigkeiten, Z. Anorg. Allg. Chem. 156 (1926) 245–257. https://doi.org/10.1002/zaac.19261560121.
Module contents
- class glasspy.predict.GlassNet(*args: Any, **kwargs: Any)
Bases:
GlassNetMTMHHybrid neural network for predicting glass properties.
This hybrid model has a multitask neural network to compute most of the properties and especialized neural networks to predict selected properties.
- Parameters:
st_models – List of the properties to use especialized models instead of using the multitask network. If default, then the model uses those properties that performed better than the multitask model.
- predict(composition: str | List[float] | List[List[float]] | ndarray | Dict[str, float] | Dict[str, List[float]] | Dict[str, ndarray] | DataFrame | ChemArray, input_cols: List[str] = [], return_dataframe: bool = True)
Makes prediction of properties.
- Parameters:
composition – Any composition-like object.
input_cols – List of strings representing the chemical entities related to each column of composition. Necessary only when composition is a list or array, ignored otherwise.
return_dataframe – If True, then returns a pandas DataFrame, else returns an array. Default value is True.
- Returns:
Predicted values of properties. Will be a DataFrame if return_dataframe is True, otherwise will be an array.
- class glasspy.predict.GlassNetMTMH(*args: Any, **kwargs: Any)
Bases:
_BaseGlassNet,_BaseGlassNetViscosityMultitask neural network for predicting glass properties.
This is the MT-MH model.
- class glasspy.predict.GlassNetMTMLP(*args: Any, **kwargs: Any)
Bases:
_BaseGlassNet,_BaseGlassNetViscosityMultitask neural network for predicting glass properties.
This is the MT-MLP model.
- class glasspy.predict.GlassNetSTNN(*args: Any, **kwargs: Any)
Bases:
_BaseGlassNetSingle-task neural network for predicting glass properties.
This is the ST-NN model.
- test_step(batch, batch_idx)
- training_step(batch, batch_idx)
- validation_step(batch, batch_idx)
- class glasspy.predict.VITRIFY(model='CHEM', framework='onnx', calibrated=True)
Bases:
PredictPredictor of the probability of forming a glass using the VITRIFY model.
VITRIFY stands for Vitrification Inference Tool for Rapid Identification of glass-Forming abilitY.
The original model was trained using the scikit-learn framework. During conversion to ONNX, all float64 values were cast to float32. As a result, compositions very close to decision boundaries may yield different predictions due to floating-point rounding.
Warning
When using the sklearn framework, scikit-learn version 1.9.0 must be installed. Other versions may produce inconsistent results.
- Parameters:
model (str) – Name of the glass-formation predictive model to use. Available options are: FEATENG, or CHEM. Defaults to “CHEM”.
framework (str) – Inference framework to use. Accepted values are “onnx” and “sklearn”. Defaults to “onnx” if not specified. If “sklearn” is selected, ensure scikit-learn version 1.9.0 is installed.
calibrated (bool) – Wether to use the calibrated model (considering 5-fold cross-validation) or not. Defaults to True.
- static citation(bibtex: bool = False) str
- property domain
- get_test_dataset()
- get_training_dataset()
- is_within_domain()
- predict(composition: str | List[float] | List[List[float]] | ndarray | Dict[str, float] | Dict[str, List[float]] | Dict[str, ndarray] | DataFrame | ChemArray, input_cols: List[str] = [], thres=None)
Classifies the compositions with respect of glass formation.
- Parameters:
composition – Any composition like object.
input_cols – List of strings representing the chemical entities related to each column of composition. Necessary only when composition is a list or array, ignored otherwise.
thres – change the decision threshold to predict the positive class (ie, forms glass). None means default threshold of 0.5. Defaults to None.
- Returns:
Array with zeros and ones. Zero represent a prediction that the composition will not form a glass while one represents the opposite.
- predict_proba(composition: str | List[float] | List[List[float]] | ndarray | Dict[str, float] | Dict[str, List[float]] | Dict[str, ndarray] | DataFrame | ChemArray, input_cols: List[str] = [])
Returns the predicted probabilities of the model.
- Parameters:
composition – Any composition like object.
input_cols – List of strings representing the chemical entities related to each column of composition. Necessary only when composition is a list or array, ignored otherwise.
- Returns:
2D Numpy array with values between 0 and 1. First column represents the probability of not forming a glass and second column represents the probability of forming a glass.
- predict_proba_glass(composition: str | List[float] | List[List[float]] | ndarray | Dict[str, float] | Dict[str, List[float]] | Dict[str, ndarray] | DataFrame | ChemArray, input_cols: List[str] = [])
Returns the predicted probability of forming a glass.
- Parameters:
composition – Any composition like object.
input_cols – List of strings representing the chemical entities related to each column of composition. Necessary only when composition is a list or array, ignored otherwise.
- Returns:
Numpy array with values between 0 and 1 representing the predicted probability of glass formation.
- class glasspy.predict.ViscNet(*args: Any, **kwargs: Any)
Bases:
_BaseViscNetViscNet predictor of viscosity and viscosity parameters.
ViscNet is a physics-informed neural network that has the MYEGA [1] viscosity equation embedded in it. See Ref. [2] for the original publication.
References
- [1] J.C. Mauro, Y. Yue, A.J. Ellison, P.K. Gupta, D.C. Allan, Viscosity of
glass-forming liquids., Proceedings of the National Academy of Sciences of the United States of America. 106 (2009) 19780–19784. https://doi.org/10.1073/pnas.0911705106.
- [2] D.R. Cassar, ViscNet: Neural network for predicting the fragility
index and the temperature-dependency of viscosity, Acta Materialia. 206 (2021) 116602. https://doi.org/10.1016/j.actamat.2020.116602. https://arxiv.org/abs/2007.03719
- absolute_features = [('ElectronAffinity', 'std1'), ('FusionEnthalpy', 'std1'), ('GSenergy_pa', 'std1'), ('GSmagmom', 'std1'), ('NdUnfilled', 'std1'), ('NfValence', 'std1'), ('NpUnfilled', 'std1'), ('atomic_radius_rahm', 'std1'), ('c6_gb', 'std1'), ('lattice_constant', 'std1'), ('mendeleev_number', 'std1'), ('num_oxistates', 'std1'), ('nvalence', 'std1'), ('vdw_radius_alvarez', 'std1'), ('vdw_radius_uff', 'std1'), ('zeff', 'std1')]
- featurizer(composition: str | List[float] | List[List[float]] | ndarray | Dict[str, float] | Dict[str, List[float]] | Dict[str, ndarray] | DataFrame | ChemArray, input_cols: List[str] = []) ndarray
Compute the chemical features used for viscosity prediction.
- Parameters:
composition – Any composition like object.
input_cols – List of strings representing the chemical entities related to each column of composition. Necessary only when composition is a list or array, ignored otherwise.
- Returns:
Array with the computed chemical features
- log_viscosity_fun(T, log_eta_inf, Tg, m)
Computes the base-10 logarithm of viscosity using the MYEGA equation.
- parameters_range = {'Tg': [400, 1400], 'log_eta_inf': [-18, 5], 'm': [10, 130]}
- weighted_features = [('FusionEnthalpy', 'min'), ('GSbandgap', 'max'), ('GSmagmom', 'mean'), ('GSvolume_pa', 'max'), ('MiracleRadius', 'std1'), ('NValence', 'max'), ('NValence', 'min'), ('NdUnfilled', 'max'), ('NdValence', 'max'), ('NsUnfilled', 'max'), ('SpaceGroupNumber', 'max'), ('SpaceGroupNumber', 'min'), ('atomic_radius', 'max'), ('atomic_volume', 'max'), ('c6_gb', 'max'), ('c6_gb', 'min'), ('max_ionenergy', 'min'), ('num_oxistates', 'max'), ('nvalence', 'min')]
- class glasspy.predict.ViscNetHuber(*args: Any, **kwargs: Any)
Bases:
ViscNetViscNet-Huber predictor of viscosity and viscosity parameters.
ViscNet-Huber is a physics-informed neural network that has the MYEGA [1] viscosity equation embedded in it. The difference between this model and ViscNet is the loss function: this model has a robust smooth-L1 loss function, while ViscNet has a MSE (L2) loss function. See Ref. [2] for the original publication.
References
- [1] J.C. Mauro, Y. Yue, A.J. Ellison, P.K. Gupta, D.C. Allan, Viscosity of
glass-forming liquids., Proceedings of the National Academy of Sciences of the United States of America. 106 (2009) 19780–19784. https://doi.org/10.1073/pnas.0911705106.
- [2] D.R. Cassar, ViscNet: Neural network for predicting the fragility
index and the temperature-dependency of viscosity, Acta Materialia. 206 (2021) 116602. https://doi.org/10.1016/j.actamat.2020.116602. https://arxiv.org/abs/2007.03719
- class glasspy.predict.ViscNetVFT(*args: Any, **kwargs: Any)
Bases:
ViscNetViscNet-VFT predictor of viscosity and viscosity parameters.
ViscNet-VFT is a physics-informed neural network that has the VFT [1-3] viscosity equation embedded in it. See Ref. [4] for the original publication.
References
- [1] H. Vogel, Das Temperatureabhängigketsgesetz der Viskosität von
Flüssigkeiten, Physikalische Zeitschrift. 22 (1921) 645–646.
- [2] G.S. Fulcher, Analysis of recent measurements of the viscosity of
glasses, Journal of the American Ceramic Society. 8 (1925) 339–355. https://doi.org/10.1111/j.1151-2916.1925.tb16731.x.
- [3] G. Tammann, W. Hesse, Die Abhängigkeit der Viscosität von der
Temperatur bie unterkühlten Flüssigkeiten, Z. Anorg. Allg. Chem. 156 (1926) 245–257. https://doi.org/10.1002/zaac.19261560121.
- [4] D.R. Cassar, ViscNet: Neural network for predicting the fragility
index and the temperature-dependency of viscosity, Acta Materialia. 206 (2021) 116602. https://doi.org/10.1016/j.actamat.2020.116602. https://arxiv.org/abs/2007.03719
- log_viscosity_fun(T, log_eta_inf, Tg, m)
Computes the base-10 logarithm of viscosity using the VFT equation.
- Reference:
- [1] H. Vogel, Das Temperatureabhängigketsgesetz der Viskosität von
Flüssigkeiten, Physikalische Zeitschrift. 22 (1921) 645–646.
- [2] G.S. Fulcher, Analysis of recent measurements of the viscosity of
glasses, Journal of the American Ceramic Society. 8 (1925) 339–355. https://doi.org/10.1111/j.1151-2916.1925.tb16731.x.
- [3] G. Tammann, W. Hesse, Die Abhängigkeit der Viscosität von der
Temperatur bie unterkühlten Flüssigkeiten, Z. Anorg. Allg. Chem. 156 (1926) 245–257. https://doi.org/10.1002/zaac.19261560121.