Giter VIP home page Giter VIP logo

bayarea-dl-summerschool's Introduction

bayarea-dl-summerschool

Torch notebooks and slides for the Bay Area Deep Learning Summer School

Installation Instructions

Install anaconda if you don't have it (instructions here for OS X)

wget http://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh
sh Miniconda-latest-MacOSX-x86_64.sh -b -p $HOME/anaconda

Add anaconda to your $PATH

export PATH=$HOME/anaconda/bin:$PATH

Install Lua & Torch

conda install lua=5.2 lua-science -c alexbw
# Although, you could install other Lua versions like 2.0 (LuaJIT), 5.1, 5.2 and 5.3

Clone this repository and start the notebook server

git clone https://github.com/alexbw/bayarea-dl-summerschool.git
cd bayarea-dl-summerschool
itorch notebook
# Will open a browser tab, then you can navigate to the notebooks

bayarea-dl-summerschool's People

Contributors

alexbw avatar malzantot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bayarea-dl-summerschool's Issues

Error: "Cannot find appropriate message handler for comm_info_request"

I have followed the instructions in README.md on OS X, but when I run the notebook, I ran into following issue:

 ~/anaconda/bin/jupyter notebook
[I 12:10:14.129 NotebookApp] [nb_conda_kernels] enabled, 2 kernels found
[I 12:10:14.695 NotebookApp] ✓ nbpresent HTML export ENABLED
[W 12:10:14.695 NotebookApp] ✗ nbpresent PDF export DISABLED: No module named nbbrowserpdf.exporters.pdf
[I 12:10:14.700 NotebookApp] [nb_conda] enabled
[I 12:10:14.767 NotebookApp] [nb_anacondacloud] enabled
[I 12:10:14.777 NotebookApp] Serving notebooks from local directory: /Users/shuang/github/bayarea-dl-summerschool/notebooks
[I 12:10:14.777 NotebookApp] 0 active kernels
[I 12:10:14.777 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 12:10:14.777 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 12:10:34.747 NotebookApp] Kernel started: a441bb05-49be-4642-b6c3-f5aaa580205d
Torch 7.0  Copyright (C) 2001-2011 Idiap, NEC Labs, NYU
Torch 7.0  Copyright (C) 2001-2011 Idiap, NEC Labs, NYU

[I 12:10:35.187 NotebookApp] Adapting to protocol v4.0 for kernel a441bb05-49be-4642-b6c3-f5aaa580205d
lua: /Users/shuang/anaconda/share/lua/5.2/itorch/main.lua:350: Cannot find appropriate message handler for comm_info_request
stack traceback:
        [C]: in function 'assert'
        /Users/shuang/anaconda/share/lua/5.2/itorch/main.lua:350: in function </Users/shuang/anaconda/share/lua/5.2/itorch/main.lua:348>
        (...tail calls...)
        /Users/shuang/anaconda/share/lua/5.2/lzmq/poller.lua:75: in function 'poll'
        /Users/shuang/anaconda/share/lua/5.2/lzmq/impl/loop.lua:307: in function 'poll'
        /Users/shuang/anaconda/share/lua/5.2/lzmq/impl/loop.lua:325: in function 'sleep_ex'
        /Users/shuang/anaconda/share/lua/5.2/lzmq/impl/loop.lua:370: in function 'start'
        /Users/shuang/anaconda/share/lua/5.2/itorch/main.lua:381: in main chunk
        [C]: in function 'require'
        (command line):1: in main chunk
        [C]: in ?
[I 12:12:06.514 NotebookApp] Kernel shutdown: a441bb05-49be-4642-b6c3-f5aaa580205d

luarocks install not working

Hi there, I installed lua and luarocks as shown and I am not able to install packages using luarocks.

For example when I type luarocks install nngraph it returns

Error: No results matching query were found.

I am able to run the notebooks though.

Training error. Help

Hello.
I teach a neural network for two of my classes.
Error occurs at the stage of training.
How to fix it?

th> require 'nn';
th> trainset = torch.load('animals_peoples2.t7')
th> testset = torch.load('animals_peoples2.t7')
th> classes = {'animals', 'peoples'}

th> print(trainset)
{
data : ByteTensor - size: 17299x3x96x96
label : ByteTensor - size: 17299
}

th> print(#trainset.data)
17299
3
96
96
[torch.LongStorage of size 4]

th> setmetatable(trainset,
..> {__index = function(t, i)
..> return {
..> t.data[i],
..> t.label[i]
..> }
..> end}
..> );

th> function trainset:size()
..> return self.data:size(1)
..> end

th> trainset.data = trainset.data:double()

th> print(trainset:size())
17299

th> print(trainset[33])
{
1 : DoubleTensor - size: 3x96x96
2 : 1
}

th> redChannel = trainset.data:select(2, 1)

th> print(#redChannel)
17299
96
96
[torch.LongStorage of size 3]

th> mean = {} -- store the mean, to normalize the test set in the future

th> stdv = {} -- store the standard-deviation for the future

th> for i=1,3 do -- over each image channel
..> mean[i] = trainset.data:select(2, 1):mean() -- mean estimation
..> print('Channel ' .. i .. ', Mean: ' .. mean[i])
..> trainset.data:select(2, 1):add(-mean[i]) -- mean subtraction
..>
..> stdv[i] = trainset.data:select(2, i):std() -- std estimation
..> print('Channel ' .. i .. ', Standard Deviation: ' .. stdv[i])
..> trainset.data:select(2, i):div(stdv[i]) -- std scaling
..> end
Channel 1, Mean: 0
Channel 1, Standard Deviation: 0
Channel 2, Mean: nan
Channel 2, Standard Deviation: 0
Channel 3, Mean: nan
Channel 3, Standard Deviation: 0

th> net = nn.Sequential()
th> net:add(nn.SpatialConvolution(3, 6, 9, 9)) -- 3 input image channels, 6 output channels, 9x9 convolution kernel
th> net:add(nn.ReLU()) -- non-linearity
th> net:add(nn.SpatialMaxPooling(2,2,2,2)) -- A max-pooling operation that looks at 2x2 windows and finds the max.
th> net:add(nn.SpatialConvolution(6, 16, 9, 9))
th> net:add(nn.ReLU()) -- non-linearity
th> net:add(nn.SpatialMaxPooling(2,2,2,2))
th> net:add(nn.View(16x9x9)) -- reshapes from a 3D tensor of 16x9x9 into 1D tensor of 16x9x9
th> net:add(nn.Linear(16x9x9, 120)) -- fully connected layer (matrix multiplication between input and weights)
th> net:add(nn.ReLU()) -- non-linearity
th> net:add(nn.Linear(120, 84))
th> net:add(nn.ReLU()) -- non-linearity
th> net:add(nn.Linear(84, 10)) -- 10 is the number of outputs of the network (in this case, 10 digits)
th> net:add(nn.LogSoftMax()) -- converts the output to a log-probability. Useful for classification problems

th> criterion = nn.ClassNLLCriterion()

th> trainer = nn.StochasticGradient(net, criterion)
th> trainer.learningRate = 0.001
th> trainer.maxIteration = 5 -- just do 5 epochs of training.

th> trainer:train(trainset)

trainer:train(trainset)
StochasticGradient: training

/root/facedetect/torch/install/share/lua/5.1/nn/THNN.lua:110: Assertion `THIndexTensor_(size)(target, 0) == batch_size' failed. at /tmp/luarocks_nn-scm-1-1625/nn/lib/THNN/generic/ClassNLLCriterion.c:50
stack traceback:
[C]: in function 'v'
/root/facedetect/torch/install/share/lua/5.1/nn/THNN.lua:110: in function 'ClassNLLCriterion_updateOutput'
...ect/torch/install/share/lua/5.1/nn/ClassNLLCriterion.lua:43: in function 'forward'
...ct/torch/install/share/lua/5.1/nn/StochasticGradient.lua:35: in function 'train'
[string "_RESULT={trainer:train(trainset)}"]:1: in main chunk
[C]: in function 'xpcall'
/root/facedetect/torch/install/share/lua/5.1/trepl/init.lua:661: in function 'repl'
...tect/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk
[C]: at 0x004064f0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.