Most recent releases are shown at the top. Each release shows:
- New: New classes, methods, functions, etc
- Changed: Additional paramaters, changes to inputs or outputs, etc
- Fixed: Bug fixes that don't change documented behaviour
Note that the top-most release is changes in the unreleased master branch on Github. Parentheses after an item show the name or github id of the contributor of that change.
Fbeta_binaryis nowFBeta
Learner.to_fp32()to go back to FP32 precision modecont_cat_splitfunction to automatically get categorical/continuous variables (thanks to RealLankinen)- Lots of new metrics thanks to Sven Becker:
mse/mean_squared_error,mae/mean_absolute_error,rmse/root_mean_squared_error,msle/ mean_squared_logarithmic_error,explained_variance,r2_score,top_k_accuracy,KappaScore,MatthewsCorreff,Precision,Recall,FBeta BatchNorm1dFlatfor using batchnorm in sequence models (e.g. RNNs, and their inputs and outputs)
- The data block API has additional checks with assertions (NaNs in columns used for inputs/labels in dataframes, empty items)
- kwargs are checked in the data block API
model_summarynow returns summary instead of printing it
- Predictions now work in FP16 mode
- Model is unwrapped at the end of a distributed training (thanks to mgrankin)
DataBunch.exportworks for multi-classification problems whereone_hot=True- Fix bug in
DatasetFormatter - Fix
LanguageLearner.predict
- If you want to import basic fastai functionality without an application, you
should now use
from fastai.basics import *instead offrom fastai import *. (However note that you now don't need either, when using an application, as mentioned in Changed below) - In fastai.text batch is now the first dimension
fastai.scriptmodule contains a simple decorator for quickly creating CLIssetup_distribdoes all setup required for distributed training for you- Sample training scripts for MNIST sample (single GPU) and CIFAR10 (multi-GPU fp16) in
examples fastai.launchmodule for simplified single-machine multi-GPU trainingcheck_perf- performance improvement recommendationsdistributedmodule with helper functions to quickly launch a distributed training- temptative use of JIT C++ extensions to code the QRNN with
batch_firstargument, it needs a proper installation of cuda to be compiled at execution time
- When importing an application such as
from fastai.vision import *you no longer need to alsofrom fastai import *
SequentialEx,MergeLayer, andres_blockto more easily create resnet and densenet architecturesno_splitmethod in the data block APIsigmoid_rangefunction to scale sigmoid to given range, along withSigmoidRangelayerDataBunchperforms a sanity check after its initialization and will throw a warning if something is wrong with the data.- More GAN stuff:
gan_critic,AdaptiveLoss,accuracy_thresh_expand, andGANDiscriminativeLR - Support for one-hot encoded labels in multiclassification problems
- Add
Dataset.Fix(same as train but withshuffle=False,drop_last=Falseand valid transforms)
- Experimental cross-connection from raw input plus extra resblock at end of unet
- Add an execution-time check for a specific version of fastprogress (
git pullfastai updates) DataBunch.exportnow serializes everything (transforms and normalization included)DataBunchnow hasfix_dlattr, which is same data astrain_dlbut without shuffle or train tfmspred_batchnow hasreconstructparam, which will reconstruct each prediction into an objectLearner.show_resultsgives a better output for image classification tasks
- Windows fixes, including:
- Most transforms can now be used in Windows with
num_workers>0 - Avoid recusion error with data blocks API
- Try to avoid default
np.int32creation where possible
- Most transforms can now be used in Windows with
y_rangefor unet output activationImage.apply_tfmsdoesn't accept any kwargs anymoresplit_from_filesworks withfrom_df/from_csv
LabelLists.load_empty(most useful for adding test sets for inference)
- Update deps to release version of pytorch v1
- pypi wheel
dataclassesdependency for py3.6 is there again
Learner.interpretis a shortcut toClassificationLearner.from_learner.
- Language models now use flattened loss, instead of flattening y in data loader
ItemList.from_foldernow has anincludeparameter to only include certain folders
Learner.loadwon't throw an error when trying to load an optimizer state of the wrong size, and silently ignore that optimizer state loading
TabularDatBunch.from_dfaccepts atest_dfargument
LanguageLearner.predictnow returns better text predictions- Unfreezing layers didn't create a new optimizer so the unfrozen layers weren't training
- Bug in
TextDataBunchwith a mistmatched test set was causing problems on the validation set
ImageCleanerwith duplicates=True to use as a duplicate detectorDatasetFormatter.from_similars()to feed the most similar indexes intoImageCleanerchunksto separate a Collection into smaller iterablesbatchnorm_2dwrapper for batchnorm with init
Learner.loadandLearner.savewill also load/save the optimizer stateImageItemListnow takes optionalconvert_modeImage.shownow usesdefaults.cmapif nocmappassedbnparam inconv_layerreplaced bynorm_typewhich takesNormTypeenum- unet kwargs are passed down to
conv_layer Learner.fitno longer creates a new optimizer at each call- Add batchnorm to end of unet
- Restore
ImageDataBunch.single_from_classes ItemList.set_itemis now a context manager, so you don't need to callclear_item- Removed
ItemList.clear_item - Init
torch.set_num_threads(4)to avoid OpenMP process creation overhead
Tokenizerwasn't using >1 thread
Learner.summaryadd_datepartDeviceDataLoader.newmethod to get a copy of aDeviceDataLoaderwhile changing an attributeDataBunch.batch_sizeallows to change the batch size of all the dataloaders
ImageDataBunch.single_from_classeshas been removedLearner.create_unetis now calledunet_learner
- Every type of items now has a
reconstructmethod that does the opposite ofItemBase.data: taking the tensor data and creating the object back Learner.show_resultsnow works across applicationsDataBunch.export: saves the internal information (classes, vocab in text, processors in tabular etc) need for inference in a file named 'export.pkl'. You can then create anempty_dataobject by usingDataBunch.load_empty(path)(wherepathpoints to where this 'export.pkl' file is). This also works across applications- GAN and CycleGAN
parallel: Run a function on every element of an array, using multiple processesicnrinitializes a weight matrix with ICNRPixelShuffle_ICNRlayer that combines PixelShuffle, a suitable conv2d, plus optional weightnorm and(scale,scale)blurringLearner.clip_gradconvenience function forGradientClippingcallbackplot_flat,plot_multi,show_multi,show_all: simple functions for showing images on subplotsItemList.to_textto save items to a text fileItemList.filter_by_randto randomly sample itemsLabelList.transform_yto use different transformation params fory(thanks for Fred Monroe)LabelList.{to_df,to_csv}to save items including labelsDataBunchconvenience properties:test_dsandsingle_dsDataBunch.single_itemto convert anItemBasein to a batch (tensor + dummy y)Learner.pred_batch()can now take an optional batch to predict, rather than grabbing its own- introduce
EmptyLabelandEmptyLabelList
lr_rangenow divides non-final layer LRs by 10, instead of 3, when called withslice(lr)Learner.loadnow has astrictargument like Pytorch'sload_state_dict- 1cycle training now uses cosine reverse annealing instead of linear
conv2dandconv_linearnow initialize weights/bias by defaultcore.to_detachnow moves data to CPUvision.models.unetnow usesPixelShuffle_ICNRfor upsampling, with optional weightnorm and blurringvision.models.unetfinal layer now has twice as many activationsone_batchmoved toDataBunch, and candetachanddenormif requestedHooksandHookcan now be used as context managers- Moved some non-image-specific functions from
vision.imagetotorch_core - Change
grid_sampleto downsample smoothly - Reduce the number of hooked modules to just those required in
vision.models.unet hook_output(s)can also hook the backward/grad nowbn_finalparam inTabularModelandcreate_cnnto add batchnorm after final affine layer
- factory methods of
TextDataBunchacceptmax_vocab(thanks to jfilter) vision.models.unetnow usesevalcorrectly when building model- classes are sorted when created to avoid having them change when restarting the notebook
- fix loading issues with the test set in
TextDataBunch - fix random bug in
TextDataBunch.from_ids(thanks to PiotrCzapla)
get_filesandget_image_filesnow returnPaths relative topath, instead of relative to.ItemList.itemsare also relative topathwhere relevant, sinceget_filesis called internallycreate_funcis removed in the data API; subclass and change thegetmethod instead (in vision, you can subclass theopenmethod if you want to change how the images are opened)
VocabandTabularTransformcan now be saved- Each application has its method to create an inference learner
model_summaryfunction for standard models (thanks to @noklam)- Added
pcatotorch.Tensor - Add methods to get embeddings from
CollabLearner
verify_image- now fixes files with corrupt EXIF data
- We can add transform to
yin the data block API - metric fbeta for single classification (thanks to wy-q)
- ItemLists can now set
self.filter_missing_yto automatically remove items from LabelLists training set that can't be labeled - revert xxmaj token and
deal_capsrule
- xxmaj token and new
deal_capsrule
Tokenizerhaspre_rulesandpost_rulesnow (for before and after tokenization)mark_fieldsis now default toFalse
FloatListto do regression- Use of real neural nets in
collab
- Remove
TextFilesListas you can now useTextListinstead - Consistent use of
cols/colin the data block API depending on if you can pass multiple columns or not - Collab is refactored with the data block API behind the scene
get_collab_learnerandget_tabular_learnerbecomecollab_learnerandtabular_learnerfor name harmonization accross applicationsget_embeddingbecomesembeddingImageDeleterandImageRelabelerare merged intoImageCleaner
show_batchworks withrows=1- Pretrained language models are saved in the correct folder (.fastai/models/)
- Splitting too slow in the data block API
- Mixup losses work with predict and TTA (thanks to bharadwaj6)
- Wrong size for the added test set in the data block API (thanks to wdhorton)
- Fix to the QRNN (thanks to PiotrCzapla)
- No changes
Learner.predictworks accross applicationsLearner.show_batchworks accross applications
tools/build-docsandtools/update-nbsscripts combined into one script- Big refactor of the data block API
download_imagesworks with different kind of suffixes (thanks to fpingham)
- We no longer import submodule names automatically with
import * - Callbacks are now inside the
callbacksnamespace if youfrom fastai import *
- All the
DataBunchfactory method use the data block API, the factory method ofDatasetsare deprecated and will be removed in a future version
learn.predictfixed- wrong dimension in dice (thanks to noklam)
CSVLoggercallback (thanks to devorfu)- Initial support for image regression problems
- If a dataset class has
learner_typethencreate_cnnuses that type to create theLearner - Introduce TaskType in
DatasetBaseto deal with single/multi-class or regression problems accross applications
datasets()now can automatically figure out what class to use in many situationsdownload_images()now saves images with their original extensions
DataBunch.dlreplaces the variousholdout,is_test, andis_trainapproaches with a single consistent enumfastai.textis fully compatible with the data block API
download_urlreads the get request withiter_contentwhich is robust to 'content-length' errors. (thanks to Francisco Ingham and Zach Caceres)download_urlhas a timeout
create_cnncorrectly calculates # features in body correctly for more architecturesTextDatasethas now two subclasses for the preprocessing steps and doesn't do that preprocesing automaticallyTextDataBunchdoesn't save the result of preprocessing automatically, you have to useTextDataBunch.saveRNNLearner.classifieris nowtext_classifier_learnerandRNN_Learner.language_modelis nowlanguage_model_learnerpil2tensoris faster and works on more image types (thanks to kasparlund)- Imports in the file picker widget (thanks to Hiromi)
- Batches of size 1 will be removed during training because of the issue with BatchNorm1d
- Confusion matrix show ints if
normalize=False(default) RNNLearner.get_predsreturn the preds in the right order (thanks to StatisticDean)num_features_modelnow works with any modelresize_methodwasn't properly set when passed toImageDataBunchresetthe RNNs at the beginning of each epoch inRNNTrainer
- add an argument
resize_methodthat tellsapply_tfmshow to resize the image to the desired size (crop, pad, squish or no) - all the image dataset have an
image_openerattribute (defaultopen_image) that can be changed. TheSegmentationDatasethas amask_openerattribute add_testandadd_test_folderin data block API
- jupyter et al no longer forced dependencies
verify_imagescan now resize images on top of checking they're not broken- LR finder plot now uses python scientific notation instead of math superset notation
ImageDataBunch.from_dfdoesn't change the dataframe
- Fix jupyter dep version
- Add tiny datasets
- remove wrong
Fbeta
- fix implementation of
fbeta
ImageDataBunch.single_from_classesto allow single image predictionsDatasetBasehasset_itemandclear_itemto force it to always returnitemDatasetBaseuses abstract_get_xand_get_ybatch_sizeproperty in DeviceDataLoaderClassificationLearner.predictto get prediction on a single item- Monkey-patched torch.Tensor so matplotlib works
Learner.create_unet- Data block API
validatenow takes optionaln_batchcreate_cnnnow returns aClassificationLearnerreturn_pathflag toLearner.saveImageDataBunch.show_batch()now works for every type of dataset, removesshow_imagesandshow_xy_imagesas a result- Monkey-patched torch.utils.data.dataloader.DataLoader to create a passthrough to the dataset
max_workersfordownload_images- Change the arguments of
ObjectDetectDatasetto make it consistent with the rest of the API, changes the return ofget_annotationsto go with it
- remove empty classes in
ImageDataBunch.from_folder
ConvLearnerctor is replaced by a function calledcreate_cnn
Learnerobjects now determine from the loss function if there is something to add on top of the models to get the true predictions
- Add
recurseflag toget_image_files show_xy_imagestakes tensors instead of Image- Add
classesto SegmentationDataset get_predsnow return the true probabilitiesTTAaverages the probabilities and not the last activations of the modelClassificationInterpretationhas been changed accordingly and thesigmoidargument has been deprecated
- Make
pred_batchfaster and remove redundent* - Bug in
Learner.pred_batch - Bug in
model_sizes(thanks to dienhoa) - Bug in
RNNLearner.classifierwhen used on a multilabel dataset
download_images: multi-process download of a file or URLsverify_images: multi-process verification of directory of images with optional deletion
ImageDataBunch.from_foldernow takesvalid_pct- master bar support in
download_url - various fixes to support the latest of
fastprogress Learner.normalize()(without args) stores calculated stats inLearner.statspred_batchmoved tobasic_trainand fixed for multiple inputslr_find()prints the next step to type when completed- New version of fastprogress used; doesn't require ipywidgets
- Removed
cifar_norm,cifar_denorm,imagenet_norm,imagenet_denorm
- pretrained language model is now downloaded directly in the .fastai/models/ folder. Use
pretrained_model=URLs.WT103 - add an argument
stop_divtoLearner.lr_find()to prevent early stopping, useful for negative losses - add an argument
convert_modetoopen_maskandSegmentationDatasetto choose the PIL conversion mode of the masks
URLs.download_wt103()has been removed
- change TextDataBunchClass method [
from_ids_files,from_tokens,from_df,from_csv,from_folder] so that classes argument is passed to the call to TextDataset - Strip space from file name when CSV has spaces
- Handle missing
loss_funcattr - Pass on the
use_bnparameter inget_tabular_learner - Bad handling when final batch has size of 1
- rolled back numpy dependency to >=1.12 (anaconda package has a upper pin on it) and to pip>=9.0.1, the old version are buggy but should be ok for fastai
- Added missing
pyyamldependency to conda too
- Use
spacy.blankinstead ofspacy.loadto avoid having to download english model
- Added missing
pyyamldependency
EarlyStoppingCallback,SaveModelCallback,TerminateOnNaNCallback(initial draft: fredguth)datapath4file(filename)returns suitable path to store or find data file calledfilename, using config file~/.fastai/config.yml, and default data directory~/.fastai/data, unless./dataexists and contains that file- MSELossFlat() loss function
- Simple integration tests for all applications
datais now calledbasic_datato avoid weird conflicts when naming our data objects datadatasets.untar_dataanddatasets.download_datawill now download to fastai home directory~/.fastai/dataif the dataset does not already exist locally./data
- add
dep_varcolumn intest_dfif it doesn't exists (Kevin Bird) - backwards=True when creating a LanguageModelLoader (mboyanov)
- Not released
- New class
ImagePointsfor targets that are a set of point coordinates - New function
Image.predict(learn:Learner)to get the activations of the model inLearnerfor an image - New function
Learner.validateto validate on a given dl (defaultvalid_dl), with maybe new metrics or callbacks - New function
error_ratewhich is just1-accuracy()
- All vision models are now in the
modelsmodule, including torchvision models (where tested and supported). So usemodelsinstead oftvmnow. If your preferred torchvision model isn't imported, feel free to test it out and tell us on the forum if it works. And if it doesn't, a PR with a test and a fix would be appreciated! ImageBBoxis now a subclass ofImagePoints- All metrics are now
Callback. You can pass a regular function likeaccuracythat will get averaged over batch or a fullCallbackthat can do more complex things - All datasets convenience functions and paths are inside the
URLsclass URLsthat are a sample have name now suffixed with_SAMPLE
- Fix
WeightDropoutin RNNs whenp=0 pad_collategets itskwargsfromTextClasDataBunch- Add small
epstostdinTabularDatasetto avoid division by zero fit_one_cycledoesn't take other callbacks- Many broken docs links fixed
- Last release without CHANGES updates