New functionalities
1) Deep kernel learning (DKL)-based Gaussian process (GP) regression.
The DKL-GP is based on [this paper](https://arxiv.org/abs/1511.02222) and can be used for predicting a functional property (or properties) from structural data such as images. Example of usage:
python3
Structural image data
n, d1, d2 = imgstack.shape
x_train = imgstack.reshape(n, d1*d2)
Property
y_train = P[:, 0] can be a scalar or vector variable
Input data dims
data_dim = x_train.shape[-1]
Initialize model
dklgp = aoi.models.dklGPR(data_dim)
Train
dklgp.fit(
x_train y_train, inputs and outputs
training_cycles=100, precision="single", lr=1e-2 training parameters
)
Make a prediction (with quantified uncertainty) with the trained model
mean, var = dklgp.predict(x_new)
For more details, see the example [notebook](https://colab.research.google.com/github/pycroscopy/atomai/blob/master/examples/notebooks/atomai_dkl_ferroic.ipynb)
2) Pre-trained models
One can now load pre-trained models for atomic feature finding in graphene and BFO-like systems. Currently limited to STEM data. Example of usage:
python
Load model for atom finding in graphene, which was trained on simulated data
model = aoi.models.load_pretrained_model("G_MD")
Apply to your data
nn_out, coords = model.predict(new_data)
As with any machine learning model, there is a caveat that the performance of pre-trained models will likely degrade significantly on the [out-of-distribution](https://arxiv.org/pdf/2007.01434.pdf) data (different feature size, presence of objects on the surface not accounted for in the simulations, etc.)
Bug fixes
- The extractor of image patches now checks for NaNs in the cropped data.