Electron Microscopy Machine Learning (emicroml)
emicroml
is a Python library for training machine learning models for
applications in microscopy.
Setting up emicroml
For instructions on installing the emicroml
library, see the
Installation instructions page.
Learning how to use emicroml
For those new to the emicroml
library, it is recommended that they take a
look at the Examples page, which contain code examples that show how
one can use the emicroml
library. While going through the examples, readers
can consult the emicroml reference guide to understand what each line of code
is doing.
Reproducing data of published papers
Ultramicroscopy X, ?? (2025)
The majority of the data presented in Ref. (INSERT REFERENCE) can be reproduced by running all of the examples listed on the page Examples of distortion estimation of CBED patterns.
Contents
- Home
- 1. Installation instructions
- 2. Reference
- 2.1. emicroml.modelling
- 2.1.1. emicroml.modelling.cbed
- 2.1.1.1. emicroml.modelling.cbed.distortion
- 2.1.1.1.1. emicroml.modelling.cbed.distortion.estimation
- 2.1.1.1.1.1. emicroml.modelling.cbed.distortion.estimation.combine_ml_dataset_files
- 2.1.1.1.1.2. emicroml.modelling.cbed.distortion.estimation.generate_and_save_ml_dataset
- 2.1.1.1.1.3. emicroml.modelling.cbed.distortion.estimation.load_ml_model_from_file
- 2.1.1.1.1.4. emicroml.modelling.cbed.distortion.estimation.load_ml_model_from_state_dict
- 2.1.1.1.1.5. emicroml.modelling.cbed.distortion.estimation.ml_data_dict_to_distortion_models
- 2.1.1.1.1.6. emicroml.modelling.cbed.distortion.estimation.ml_data_dict_to_signals
- 2.1.1.1.1.7. emicroml.modelling.cbed.distortion.estimation.normalize_normalizable_elems_in_ml_data_dict
- 2.1.1.1.1.8. emicroml.modelling.cbed.distortion.estimation.split_ml_dataset_file
- 2.1.1.1.1.9. emicroml.modelling.cbed.distortion.estimation.unnormalize_normalizable_elems_in_ml_data_dict
- 2.1.1.1.1.10. emicroml.modelling.cbed.distortion.estimation.DefaultCBEDPatternGenerator
- 2.1.1.1.1.11. emicroml.modelling.cbed.distortion.estimation.DefaultDistortionModelGenerator
- 2.1.1.1.1.12. emicroml.modelling.cbed.distortion.estimation.MLDataset
- 2.1.1.1.1.13. emicroml.modelling.cbed.distortion.estimation.MLDatasetManager
- 2.1.1.1.1.14. emicroml.modelling.cbed.distortion.estimation.MLModel
- 2.1.1.1.1.15. emicroml.modelling.cbed.distortion.estimation.MLModelTester
- 2.1.1.1.1.16. emicroml.modelling.cbed.distortion.estimation.MLModelTrainer
- 2.1.1.1.1. emicroml.modelling.cbed.distortion.estimation
- 2.1.1.1. emicroml.modelling.cbed.distortion
- 2.1.2. emicroml.modelling.lr
- 2.1.2.1. emicroml.modelling.lr.LRSchedulerManager
LRSchedulerManager
LRSchedulerManager.core_attrs
LRSchedulerManager.de_pre_serialization_funcs
LRSchedulerManager.de_pre_serialize()
LRSchedulerManager.dump()
LRSchedulerManager.dumps()
LRSchedulerManager.get_core_attrs()
LRSchedulerManager.get_de_pre_serialization_funcs()
LRSchedulerManager.get_pre_serialization_funcs()
LRSchedulerManager.get_validation_and_conversion_funcs()
LRSchedulerManager.load()
LRSchedulerManager.loads()
LRSchedulerManager.pre_serialization_funcs
LRSchedulerManager.pre_serialize()
LRSchedulerManager.total_num_steps
LRSchedulerManager.update()
LRSchedulerManager.validation_and_conversion_funcs
- 2.1.2.2. emicroml.modelling.lr.schedulers
- 2.1.2.2.1. emicroml.modelling.lr.schedulers.BaseLRScheduler
- 2.1.2.2.2. emicroml.modelling.lr.schedulers.Constant
- 2.1.2.2.3. emicroml.modelling.lr.schedulers.CosineAnnealingWithWarmRestarts
- 2.1.2.2.4. emicroml.modelling.lr.schedulers.Exponential
- 2.1.2.2.5. emicroml.modelling.lr.schedulers.Generic
- 2.1.2.2.6. emicroml.modelling.lr.schedulers.Linear
- 2.1.2.2.7. emicroml.modelling.lr.schedulers.Nonsequential
- 2.1.2.2.8. emicroml.modelling.lr.schedulers.ReduceOnPlateau
- 2.1.2.2.9. emicroml.modelling.lr.schedulers.Sequential
- 2.1.2.1. emicroml.modelling.lr.LRSchedulerManager
- 2.1.3. emicroml.modelling.optimizers
- 2.1.3.1. emicroml.modelling.optimizers.AdamW
AdamW
AdamW.core_attrs
AdamW.de_pre_serialization_funcs
AdamW.de_pre_serialize()
AdamW.dump()
AdamW.dumps()
AdamW.get_core_attrs()
AdamW.get_de_pre_serialization_funcs()
AdamW.get_pre_serialization_funcs()
AdamW.get_validation_and_conversion_funcs()
AdamW.load()
AdamW.loads()
AdamW.pre_serialization_funcs
AdamW.pre_serialize()
AdamW.update()
AdamW.validation_and_conversion_funcs
- 2.1.3.2. emicroml.modelling.optimizers.BaseMLOptimizer
BaseMLOptimizer
BaseMLOptimizer.core_attrs
BaseMLOptimizer.de_pre_serialization_funcs
BaseMLOptimizer.de_pre_serialize()
BaseMLOptimizer.dump()
BaseMLOptimizer.dumps()
BaseMLOptimizer.get_core_attrs()
BaseMLOptimizer.get_de_pre_serialization_funcs()
BaseMLOptimizer.get_pre_serialization_funcs()
BaseMLOptimizer.get_validation_and_conversion_funcs()
BaseMLOptimizer.load()
BaseMLOptimizer.loads()
BaseMLOptimizer.pre_serialization_funcs
BaseMLOptimizer.pre_serialize()
BaseMLOptimizer.update()
BaseMLOptimizer.validation_and_conversion_funcs
- 2.1.3.3. emicroml.modelling.optimizers.Generic
Generic
Generic.core_attrs
Generic.de_pre_serialization_funcs
Generic.de_pre_serialize()
Generic.dump()
Generic.dumps()
Generic.get_core_attrs()
Generic.get_de_pre_serialization_funcs()
Generic.get_pre_serialization_funcs()
Generic.get_validation_and_conversion_funcs()
Generic.load()
Generic.loads()
Generic.pre_serialization_funcs
Generic.pre_serialize()
Generic.update()
Generic.validation_and_conversion_funcs
- 2.1.3.4. emicroml.modelling.optimizers.SGD
SGD
SGD.core_attrs
SGD.de_pre_serialization_funcs
SGD.de_pre_serialize()
SGD.dump()
SGD.dumps()
SGD.get_core_attrs()
SGD.get_de_pre_serialization_funcs()
SGD.get_pre_serialization_funcs()
SGD.get_validation_and_conversion_funcs()
SGD.load()
SGD.loads()
SGD.pre_serialization_funcs
SGD.pre_serialize()
SGD.update()
SGD.validation_and_conversion_funcs
- 2.1.3.1. emicroml.modelling.optimizers.AdamW
- 2.1.1. emicroml.modelling.cbed
- 2.2. emicroml.version
- 2.1. emicroml.modelling
- 3. Examples
- 3.1. Examples of CBED-related tasks
- 3.1.1. Examples of CBED multislice simulations
- 3.1.1.1. Generating the atomic coordinates of a model of MoS2
- 3.1.1.2. Generating the atomic coordinates of a model of amorphous C superblock
- 3.1.1.3. Generating the atomic coordinates of a model of MoS2 on amorphous C
- 3.1.1.4. Generating the potential slices of a model of MoS2 on amorphous C
- 3.1.1.5. Generating simulated CBED patterns of a sample of MoS2 on amorphous C
- 3.1.2. Examples of distortion estimation of CBED patterns
- 3.1.2.1. Generating machine learning datasets for training and validation
- 3.1.2.2. Combining then splitting machine learning datasets for training and validation
- 3.1.2.3. Training a machine learning model
- 3.1.2.4. Generating machine learning datasets for the machine learning model test set #1
- 3.1.2.5. Combining machine learning datasets for the machine learning model test set #1
- 3.1.2.6. Running the machine learning model test set #1
- 3.1.2.7. Running the RGM test set #1
- 3.1.2.8. Analyzing machine learning model training results
- 3.1.2.9. Analyzing machine learning model testing results
- 3.1.2.10. Correcting distortion in SAED data
- 3.1.1. Examples of CBED multislice simulations
- 3.1. Examples of CBED-related tasks
- 4. Literature
- 5. License