![]() ![]() We check its shape – the data is a 3D Array, (col,row,item), and the labels are integers. I would like to implement something similar for CorpusLoaders.jl It is a nice implementation, simply done using file(path) || download(url, path) at the start of the method. The first time you call one of its data functions it will download the data. It is a handy way to get hold of the data. We are going to use the MNIST distribution, from the MLDatasets.jl. ![]() In : #Training Hyper Parameter const learning_rate = 0.001 const training_iters = 2 #Just two, becuase I don't have anything to stop overfitting and I don't got all day const batch_size = 256 const display_step = 100 #How often to display the # Network Parameters const n_input = 28 # MNIST data input (img shape: 28*28) const n_steps = 28 # timesteps const n_hidden = 128 # hidden layer num of features const n_classes = 10 # MNIST total classes (0-9 digits) The other parameters whould be fairly self explainitory. Out network has 28 inputs – one row of pixels, and each image consists of 28 time steps so each row is shown. We will begin by defining some of the parameters for our network as constants. In : using TensorFlow using Distributions using ProgressMeter using MLLabelUtils using MLDataUtils using MLDatasets using Base. We will go through each package we use in turn. You also need to install TensorFlow, as it is not automatically installed by the TensorFlow.jl package. So you will need to do the git checkout stuff to make that work,īut hopefully very soon that will be merged into master, so just the normal Pkg.add will surfice. MLDatasets.jl is not yet registers so you need to clone that one.Īlso right now (), we are using the dev branch of MLDataUtils.jl, You can install the packages used in this demo by running: To do this we are going to use a bunch of packages from the JuliaML Org, as well as a few others.Ī lot of the packages in JuliaML are evolving fast, so somethings here may be wrong. This is a toy problem to demonstrate that it can. So the LSTM network must remember the last 27 prior rows. ![]() The task is made into a time series task, by the images arriving one row at at a time Īnd the network is asked to output which class at the end after seeing the 28th row. This is not a sensible use of LSTM, after all it is not a time series task. The normal way to solve such problems is a ConvNet. The task is to use LSTM to classify MNIST digits. There are also some differences in terms of network-shape. It is based on Aymeric Damien’s LSTM tutorial in Python.Īll the explinations are my own, but the code is generally similar in intent. This is a demonstration of using JuliaML and TensorFlow to train an LSTM network. ![]()
0 Comments
Leave a Reply. |