From 72cd976af3f29177410be29c618137a8eb9b0b1d Mon Sep 17 00:00:00 2001 From: lorenzoh Date: Mon, 20 Sep 2021 14:43:42 +0200 Subject: [PATCH] Release v0.2.0 (#174) * Improve links in tabular tutorial * bump version * add more links to Changelog * fix method finding bug --- CHANGELOG.md | 9 +++++---- Project.toml | 2 +- notebooks/tabularclassification.ipynb | 26 +++++++++++++------------- src/fasterai/methodregistry.jl | 2 +- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6af001e7c..25e904f3ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,18 +1,19 @@ # Changelog + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] - 2020-07-32 – now +## 0.2.0 ### Added - High-level API "FasterAI" - dataset recipes - learning method helpers - - Find datasets and learning methods based on `Block`s: `finddataset`, `findlearningmethods` - - `loaddataset` for quickly loading data containers from configured recipes + - Find datasets and learning methods based on `Block`s: [`finddatasets`](https://fluxml.ai/FastAI.jl/dev/REFERENCE/FastAI.Datasets.Datasets.finddatasets.html), [`findlearningmethods`](https://fluxml.ai/FastAI.jl/dev/REFERENCE/FastAI.findlearningmethods.html) + - [`loaddataset`](https://fluxml.ai/FastAI.jl/dev/REFERENCE/FastAI.Datasets.Datasets.loaddataset.html) for quickly loading data containers from configured recipes - Data container recipes (`DatasetRecipe`, `loadrecipe`) - Documentation setions for FasterAI interfaces: - [Discovery](https://fluxml.ai/FastAI.jl/dev/docs/discovery.md.html) @@ -20,8 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - New interfaces - `blockbackbone` creates a default backbone for an input block - Support for tabular data along with recipes and learning methods: - - [`TabularPreprocessing`], [`TableRow`], [`TableDataset`], [`TabularClassificiationSingle`], [`TabularRegression`] - [Tabular classification tutorial](https://fluxml.ai/FastAI.jl/dev/notebooks/tabularclassification.ipynb.html) + - [`TabularPreprocessing`](https://fluxml.ai/FastAI.jl/dev/REFERENCE/FastAI.TabularPreprocessing.html), [`TableRow`](https://fluxml.ai/FastAI.jl/dev/REFERENCE/FastAI.TableRow.html), [`TableDataset`](https://fluxml.ai/FastAI.jl/dev/REFERENCE/FastAI.Datasets.TableDataset.html), [`TabularClassificiationSingle`](https://fluxml.ai/FastAI.jl/dev/REFERENCE/FastAI.TabularClassificationSingle.html), [`TabularRegression`](https://fluxml.ai/FastAI.jl/dev/REFERENCE/FastAI.TabularRegression.html) ### Changed diff --git a/Project.toml b/Project.toml index 1697486679..dd24526dcb 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "FastAI" uuid = "5d0beca9-ade8-49ae-ad0b-a3cf890e669f" authors = ["Lorenz Ohly", "Julia Community"] -version = "0.1.0" +version = "0.2.0" [deps] Animations = "27a7e980-b3e6-11e9-2bcd-0b925532e340" diff --git a/notebooks/tabularclassification.ipynb b/notebooks/tabularclassification.ipynb index ef190d4229..ea7fd8a1cd 100644 --- a/notebooks/tabularclassification.ipynb +++ b/notebooks/tabularclassification.ipynb @@ -36,7 +36,7 @@ "id": "19f9ec64", "metadata": {}, "source": [ - "We can quickly download and get the path of any dataset from fastai by using `datasetpath`. Once we have the path, we'll load the data in a `TableContainer`. By default, if we pass in just the path to `TableContainer`, the data is loaded in a `DataFrame`, but we can use any package for accessing our data, and pass an object satisfying the Tables.jl interface to it." + "We can quickly download and get the path of any dataset from fastai by using [`datasetpath`](#). Once we have the path, we'll load the data in a [`TableDataset`](#). By default, if we pass in just the path to [`TableDataset`](#), the data is loaded in a `DataFrame`, but we can use any package for accessing our data, and pass an object satisfying the [Tables.jl](https://github.com/JuliaData/Tables.jl) interface to it." ] }, { @@ -91,7 +91,7 @@ "id": "bd63b82d", "metadata": {}, "source": [ - "In case our data was present in a different format for eg. parquet, it could be loaded in a TableContainer as shown below." + "In case our data was present in a different format for eg. parquet, it could be loaded into a data container as follows:" ] }, { @@ -110,7 +110,7 @@ "id": "a77c191c", "metadata": {}, "source": [ - "`mapobs` is used here to split our target column from the rest of the row in a lazy manner." + "[`mapobs`](#) is used here to split our target column from the rest of the row in a lazy manner, so that each observation consists of a row of inputs and a target variable." ] }, { @@ -130,11 +130,11 @@ "source": [ "To create a learning method for tabular classification task, we need an input block, an output block, and the encodings to be performed on the data.\n", "\n", - "The input block here is a `TableRow` which contains information about the nature of the columns (ie. categorical or continuous) along with an indexable collection mapping categorical column names to a collection with distinct classes in that column. We can get this mapping by using the `gettransformationdict` method with `DataAugmentation.Categorify`.\n", + "The input block here is a [`TableRow`](#) which contains information about the nature of the columns (ie. categorical or continuous) along with an indexable collection mapping categorical column names to a collection with distinct classes in that column. We can get this mapping by using the `gettransformationdict` method with [`DataAugmentation.Categorify`](#).\n", "\n", - "The outblock block used is `Label` for single column classification and the unique classes have to passed to it.\n", + "The outblock block used is [`Label`](#) for single column classification and the unique classes have to passed to it.\n", "\n", - "This is followed by the encodings which needs to be applied on our input and output blocks. For the input block, we have used the `gettransforms` function here to get a standard bunch of transformations to apply, but this can be easily customized by passing in any tabular transformation from DataAugmentation.jl or a composition of those, to `TabularPreprocessings`. In addition to this, we have just one-hot encoded the outblock." + "This is followed by the encodings which needs to be applied on our input and output blocks. For the input block, we have used the `gettransforms` function here to get a standard bunch of transformations to apply, but this can be easily customized by passing in any tabular transformation from DataAugmentation.jl or a composition of those, to [`TabularPreprocessing`](#). In addition to this, we have just one-hot encoded the outblock." ] }, { @@ -193,7 +193,7 @@ "id": "ad69519e", "metadata": {}, "source": [ - "In case our initial problem wasn't a classification task, and we had a continuous target column, we would need to perform tabular regression. To create a learning method suitable for regression, we use a `Continuous` block for representing our target column. This can be done even with multiple continuous target columns by just passing the number of columns in `Continuous`. For example, the method here could be used for 3 targets." + "In case our initial problem wasn't a classification task, and we had a continuous target column, we would need to perform tabular regression. To create a learning method suitable for regression, we use a [`Continuous`](#) block for representing our target column. This can be done even with multiple continuous target columns by just passing the number of columns in `Continuous`. For example, the method here could be used for 3 targets." ] }, { @@ -218,7 +218,7 @@ "id": "5a1d9474", "metadata": {}, "source": [ - "To get an overview of the learning method created, and as a sanity test, we can use the `describemethod` function. This shows us what encodings will be applied to which blocks, and how the predicted ŷ values are decoded." + "To get an overview of the learning method created, and as a sanity test, we can use [`describemethod`](#). This shows us what encodings will be applied to which blocks, and how the predicted ŷ values are decoded." ] }, { @@ -321,7 +321,7 @@ "id": "bb9da109", "metadata": {}, "source": [ - "`getobs` gets us a row of data from the `TableContainer`, which we encode here. This gives us a tuple with the input and target. The input here is again a tuple, containing the categorical values (which have been label encoded or \"categorified\") and the continuous values (which have been normalized and any missing values have been filled). " + "`getobs` gets us a row of data from the `TableDataset`, which we encode here. This gives us a tuple with the input and target. The input here is again a tuple, containing the categorical values (which have been label encoded or \"categorified\") and the continuous values (which have been normalized and any missing values have been filled). " ] }, { @@ -376,7 +376,7 @@ "id": "b7105af7", "metadata": {}, "source": [ - "To quickly get a model suitable for our learning method, we can use the `methodmodel` function." + "To get a model suitable for our learning method, we can use [`methodmodel`](#) which constructs a suitable model based on the target block. " ] }, { @@ -436,7 +436,7 @@ "id": "0fb73fd4", "metadata": {}, "source": [ - "It is really simple to create a custom backbone using the functions present in `FastAI.Models`." + "Of course you can also create a custom backbone using the functions present in `FastAI.Models`." ] }, { @@ -521,7 +521,7 @@ "id": "22eb6dc7", "metadata": {}, "source": [ - "To directly get a `Learner` suitable for our method and data, we can use the `methodlearner` function. " + "To directly get a [`Learner`](#) suitable for our method and data, we can use the [`methodlearner`](#) function. This creates both batched data loaders and a model for us." ] }, { @@ -552,7 +552,7 @@ "id": "d5b4b0be", "metadata": {}, "source": [ - "Once we have our learner, we can just call [`fitonecycle!`](#) on it to train it for the desired number of epochs." + "Once we have a `Learner`, we can call [`fitonecycle!`](#) on it to train it for the desired number of epochs:" ] }, { diff --git a/src/fasterai/methodregistry.jl b/src/fasterai/methodregistry.jl index a8591d1c23..3c4707c3c0 100644 --- a/src/fasterai/methodregistry.jl +++ b/src/fasterai/methodregistry.jl @@ -36,7 +36,7 @@ julia> findlearningmethods((Image, Any)) ``` """ function findlearningmethods(reg::LearningMethodRegistry, blocktypes=Any) - return [methodfn for (methodfn, methodblocks) in reg.methods if typify(blocktypes) <: methodblocks] + return [methodfn for (methodfn, methodblocks) in reg.methods if methodblocks <: typify(blocktypes)] end