Using CAREamics
The CAREamist API is the recommended way to use CAREamics, it is a two stage process, in
which users first define a configuration and then use a the CAREamist to run their
training and prediction.
More advanced users wishing to have more control over the training and prediction process can re-use CAREamics module in a Pytorch Lightning script, which we refer to as the Lightning API.
Quick start
from careamics.careamist import CAREamist
from careamics.config.factories import create_n2v_config
# create a configuration
config = create_n2v_config(
experiment_name="n2v_training",
data_type="array", # (1)!
axes="YX",
patch_size=[64, 64],
batch_size=8,
num_epochs=30,
)
# instantiate a careamist
careamist = CAREamist(config)
# train the model
careamist.train(train_data=train_data) # (2)!
# once trained, predict
prediction = careamist.predict(pred_data=pred_data)
-
This is training from arrays in memory, but this can also be done with files on disk.
-
The only important thing is that the data passed is coherent with the choice in the configuration.
from careamics.careamist import CAREamist
from careamics.config.factories import create_care_config
# create a configuration
config = create_care_config(
experiment_name="care_2D",
data_type="array", # (1)!
axes="YX",
patch_size=[64, 64],
batch_size=8,
num_epochs=30,
)
# instantiate a careamist
careamist = CAREamist(config)
# train the model
careamist.train(
train_data=train_data, # (2)!
train_data_target=train_target,
val_data=val_data,
val_data_target=val_target,
)
# once trained, predict
prediction = careamist.predict(pred_data=pred_data)
-
This is training from arrays in memory, but this can also be done with files on disk.
-
The only important thing is that the data passed is coherent with the choice in the configuration.
Explore CAREamics
-
Configuration
Configure your experiment.
-
Data preparation
Prepare your data.
-
Training
Train CAREamics.
-
Logging
Follow the training progress and inspect the results.
-
Prediction
Use the trained model to predict.
-
Lightning API
Use CAREamics modules in your own PyTorch Lightning script.