Flux.jl/dev/datasets/index.html

30 lines
15 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Datasets · Flux</title><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-36890222-9', 'auto');
ga('send', 'pageview', {'page': location.pathname + location.search + location.hash});
</script><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link href="../assets/flux.css" rel="stylesheet" type="text/css"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit">Flux</span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><span class="tocitem">Building Models</span><ul><li><a class="tocitem" href="../models/basics/">Basics</a></li><li><a class="tocitem" href="../models/recurrence/">Recurrence</a></li><li><a class="tocitem" href="../models/regularisation/">Regularisation</a></li><li><a class="tocitem" href="../models/layers/">Model Reference</a></li><li><a class="tocitem" href="../models/advanced/">Advanced Model Building</a></li><li><a class="tocitem" href="../models/nnlib/">NNlib</a></li></ul></li><li><span class="tocitem">Handling Data</span><ul><li><a class="tocitem" href="../data/onehot/">One-Hot Encoding</a></li><li><a class="tocitem" href="../data/dataloader/">DataLoader</a></li></ul></li><li><span class="tocitem">Training Models</span><ul><li><a class="tocitem" href="../training/optimisers/">Optimisers</a></li><li><a class="tocitem" href="../training/training/">Training</a></li></ul></li><li><a class="tocitem" href="../gpu/">GPU Support</a></li><li><a class="tocitem" href="../saving/">Saving &amp; Loading</a></li><li><a class="tocitem" href="../ecosystem/">The Julia Ecosystem</a></li><li><a class="tocitem" href="../utilities/">Utility Functions</a></li><li><a class="tocitem" href="../performance/">Performance Tips</a></li><li class="is-active"><a class="tocitem" href>Datasets</a></li><li><a class="tocitem" href="../community/">Community</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Datasets</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Datasets</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/FluxML/Flux.jl/blob/master/docs/src/datasets.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Datasets-1"><a class="docs-heading-anchor" href="#Datasets-1">Datasets</a><a class="docs-heading-anchor-permalink" href="#Datasets-1" title="Permalink"></a></h1><p>Flux includes several standard machine learning datasets.</p><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.Iris.features-Tuple{}" href="#Flux.Data.Iris.features-Tuple{}"><code>Flux.Data.Iris.features</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">features()</code></pre><p>Get the features of the iris dataset. This is a 4x150 matrix of Float64 elements. It has a row for each feature (sepal length, sepal width, petal length, petal width) and a column for each example.</p><pre><code class="language-julia-repl">julia&gt; features = Flux.Data.Iris.features();
julia&gt; summary(features)
&quot;4×150 Array{Float64,2}&quot;
julia&gt; features[:, 1]
4-element Array{Float64,1}:
5.1
3.5
1.4
0.2</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/iris.jl#L51-L71">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.Iris.labels-Tuple{}" href="#Flux.Data.Iris.labels-Tuple{}"><code>Flux.Data.Iris.labels</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">labels()</code></pre><p>Get the labels of the iris dataset, a 150 element array of strings listing the species of each example.</p><pre><code class="language-julia-repl">julia&gt; labels = Flux.Data.Iris.labels();
julia&gt; summary(labels)
&quot;150-element Array{String,1}&quot;
julia&gt; labels[1]
&quot;Iris-setosa&quot;</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/iris.jl#L29-L44">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.MNIST.images-Tuple{}" href="#Flux.Data.MNIST.images-Tuple{}"><code>Flux.Data.MNIST.images</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">images()
images(:test)</code></pre><p>Load the MNIST images.</p><p>Each image is a 28×28 array of <code>Gray</code> colour values (see <a href="https://github.com/JuliaGraphics/Colors.jl">Colors.jl</a>).</p><p>Return the 60,000 training images by default; pass <code>:test</code> to retrieve the 10,000 test images.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/mnist.jl#L80-L91">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.MNIST.labels-Tuple{}" href="#Flux.Data.MNIST.labels-Tuple{}"><code>Flux.Data.MNIST.labels</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">labels()
labels(:test)</code></pre><p>Load the labels corresponding to each of the images returned from <a href="#Flux.Data.MNIST.images-Tuple{}"><code>images()</code></a>. Each label is a number from 0-9.</p><p>Return the 60,000 training labels by default; pass <code>:test</code> to retrieve the 10,000 test labels.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/mnist.jl#L99-L108">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.FashionMNIST.images-Tuple{}" href="#Flux.Data.FashionMNIST.images-Tuple{}"><code>Flux.Data.FashionMNIST.images</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">images()
images(:test)</code></pre><p>Load the Fashion-MNIST images.</p><p>Each image is a 28×28 array of <code>Gray</code> colour values (see <a href="https://github.com/JuliaGraphics/Colors.jl">Colors.jl</a>).</p><p>Return the 60,000 training images by default; pass <code>:test</code> to retrieve the 10,000 test images.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/fashion-mnist.jl#L30-L41">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.FashionMNIST.labels-Tuple{}" href="#Flux.Data.FashionMNIST.labels-Tuple{}"><code>Flux.Data.FashionMNIST.labels</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">labels()
labels(:test)</code></pre><p>Load the labels corresponding to each of the images returned from <a href="#Flux.Data.FashionMNIST.images-Tuple{}"><code>images()</code></a>. Each label is a number from 0-9.</p><p>Return the 60,000 training labels by default; pass <code>:test</code> to retrieve the 10,000 test labels.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/fashion-mnist.jl#L49-L58">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.CMUDict.phones-Tuple{}" href="#Flux.Data.CMUDict.phones-Tuple{}"><code>Flux.Data.CMUDict.phones</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">phones()</code></pre><p>Return a <code>Vector</code> containing the phones used in the CMU Pronouncing Dictionary.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/cmudict.jl#L27-L31">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.CMUDict.symbols-Tuple{}" href="#Flux.Data.CMUDict.symbols-Tuple{}"><code>Flux.Data.CMUDict.symbols</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">symbols()</code></pre><p>Return a <code>Vector</code> containing the symbols used in the CMU Pronouncing Dictionary. A symbol is a phone with optional auxiliary symbols, indicating for example the amount of stress on the phone.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/cmudict.jl#L38-L44">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.CMUDict.rawdict-Tuple{}" href="#Flux.Data.CMUDict.rawdict-Tuple{}"><code>Flux.Data.CMUDict.rawdict</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">rawdict()</code></pre><p>Return the unfiltered CMU Pronouncing Dictionary.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/cmudict.jl#L51-L55">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.CMUDict.cmudict-Tuple{}" href="#Flux.Data.CMUDict.cmudict-Tuple{}"><code>Flux.Data.CMUDict.cmudict</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">cmudict()</code></pre><p>Return a filtered CMU Pronouncing Dictionary.</p><p>It is filtered so each word contains only ASCII characters and a combination of word characters (as determined by the regex engine using <code>\w</code>), &#39;-&#39; and &#39;.&#39;.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/cmudict.jl#L64-L71">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.Sentiment.train-Tuple{}" href="#Flux.Data.Sentiment.train-Tuple{}"><code>Flux.Data.Sentiment.train</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">train()</code></pre><p>Return the train split of the Stanford Sentiment Treebank. The data is in <a href="https://en.wikipedia.org/wiki/Treebank">treebank</a> format.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/sentiment.jl#L43-L48">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.Sentiment.test-Tuple{}" href="#Flux.Data.Sentiment.test-Tuple{}"><code>Flux.Data.Sentiment.test</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">test()</code></pre><p>Return the test split of the Stanford Sentiment Treebank. The data is in <a href="https://en.wikipedia.org/wiki/Treebank">treebank</a> format.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/sentiment.jl#L51-L56">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Flux.Data.Sentiment.dev-Tuple{}" href="#Flux.Data.Sentiment.dev-Tuple{}"><code>Flux.Data.Sentiment.dev</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">dev()</code></pre><p>Return the dev split of the Stanford Sentiment Treebank. The data is in <a href="https://en.wikipedia.org/wiki/Treebank">treebank</a> format.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/FluxML/Flux.jl/blob/ddd0f4e747347555894f71ae275ac3906fc87b9e/src/data/sentiment.jl#L59-L64">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../performance/">« Performance Tips</a><a class="docs-footer-nextpage" href="../community/">Community »</a></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Wednesday 27 May 2020 11:52">Wednesday 27 May 2020</span>. Using Julia version 1.3.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>