GlassPy: predicting

Introduction

GlassPy contains two prediction models: GlassNet and ViscNet. GlassNet is a multitask deep neural network capable of predicting 85 different glass properties and the temperature dependence of viscosity. ViscNet is a physics-informed deep neural network capable of predicting the temperature dependence of viscosity. Both models were trained with data from the SciGlass database.

GlassNet basic usage

Below is a minimal example of how to load and use the GlassNet model.

[1]:
from glasspy.predict import GlassNet

model = GlassNet()
composition = "Li2O(SiO2)2"
predictions = model.predict(composition)
predictions
[1]:
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9 ... Cp1673K TMaxGrowthVelocity MaxGrowthVelocity CrystallizationPeak CrystallizationOnset SurfaceTensionAboveTg SurfaceTension1173K SurfaceTension1473K SurfaceTension1573K SurfaceTension1673K
0 1656.661908 1275.017006 1178.333404 1064.154863 956.535513 893.408138 857.634124 820.458542 779.195534 755.95825 ... 1697.079401 1021.145519 -6.457833 880.670801 787.958282 0.322871 0.299307 0.32676 0.314809 0.313336

1 rows × 85 columns

A composition can also be defined using a dictionary.

[2]:
composition = {
    "SiO2": 2,
    "Li2O": 1,
}
predictions = model.predict(composition)
predictions
[2]:
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9 ... Cp1673K TMaxGrowthVelocity MaxGrowthVelocity CrystallizationPeak CrystallizationOnset SurfaceTensionAboveTg SurfaceTension1173K SurfaceTension1473K SurfaceTension1573K SurfaceTension1673K
0 1656.661908 1275.017006 1178.333404 1064.154863 956.535513 893.408138 857.634124 820.458542 779.195534 755.95825 ... 1697.079401 1021.145519 -6.457833 880.670801 787.958282 0.322871 0.299307 0.32676 0.314809 0.313336

1 rows × 85 columns

GlassNet also accepts pandas DataFrames as input. Note that each row represents a material and that only columns related to compositions can exist in the DataFrame.

[3]:
import pandas as pd

data = [
    [1, 0, 2],
    [0, 1, 2],
    [1, 1, 2],
]

df = pd.DataFrame(data, columns=["Li2O", "Na2O", "SiO2"])
df
[3]:
Li2O Na2O SiO2
0 1 0 2
1 0 1 2
2 1 1 2
[4]:
predictions = model.predict(df)
predictions
[4]:
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9 ... Cp1673K TMaxGrowthVelocity MaxGrowthVelocity CrystallizationPeak CrystallizationOnset SurfaceTensionAboveTg SurfaceTension1173K SurfaceTension1473K SurfaceTension1573K SurfaceTension1673K
0 1656.661908 1275.016943 1178.333278 1064.154863 956.535513 893.408138 857.634124 820.458542 779.195534 755.958209 ... 1697.079401 1021.145409 -6.457834 880.670883 787.958192 0.322871 0.299307 0.326760 0.314809 0.313336
1 1766.655967 1513.411310 1279.021806 1123.006920 1035.724017 954.737548 912.160878 849.827548 809.466760 781.277537 ... 1484.994346 1064.050456 -6.311865 967.346880 861.877353 0.278585 0.307567 0.290559 0.286678 0.266966
2 1556.850784 1233.614128 1101.165289 979.065643 921.910502 852.842278 785.283328 760.537597 724.843873 694.542253 ... 1746.768714 1077.191691 -5.137043 828.439517 764.867252 0.299150 0.303260 0.320007 0.318062 0.296329

3 rows × 85 columns

GlassNet can also predict viscosity and the MYEGA viscosity equation parameters.

[5]:
predictions = model.predict_log10_viscosity(
    T=1000,
    composition=df,
)
predictions
[5]:
array([3.42916597, 4.37478355, 2.76390286])
[6]:
viscosity_parameters = model.viscosity_parameters(df)
viscosity_parameters
[6]:
log10_eta_infinity (Pa.s) Tg_MYEGA (K) fragility
0 -1.237548 697.874082 43.157955
1 -1.741297 710.712897 35.971436
2 -1.619815 637.988120 39.360906

ViscNet basic usage

The usage of ViscNet is similar to GlassNet. In fact, GlassNet performs better than ViscNet, so it is recommended to use GlassNet for viscosity prediction. Nevertheless, below is a minimal example of loading and using ViscNet.

[7]:
from glasspy.predict import ViscNet

model = ViscNet()
log10_viscosity = model.predict(T=1000, composition=df)
log10_viscosity
[7]:
array([5.1991167, 5.511484 , 5.9079647], dtype=float32)
[8]:
fragility = model.predict_fragility(df)
print(fragility)
[35.54799  27.815027 32.5404  ]
[9]:
Tg = model.predict_Tg(df)
print(Tg)
[751.4873  762.72046 784.432  ]