A Practical Guide to Training Restricted Boltzmann Machines

Slides:



Advertisements
Similar presentations
Thomas Trappenberg Autonomous Robotics: Supervised and unsupervised learning.
Advertisements

Deep Learning Bing-Chen Tsai 1/21.
Linear Regression.
CS590M 2008 Fall: Paper Presentation
Computer vision: models, learning and inference Chapter 8 Regression.
CSCI 347 / CS 4206: Data Mining Module 07: Implementations Topic 03: Linear Models.
How to do backpropagation in a brain
Resampling techniques Why resampling? Jacknife Cross-validation Bootstrap Examples of application of bootstrap.
CSC321: Introduction to Neural Networks and Machine Learning Lecture 20 Learning features one layer at a time Geoffrey Hinton.
Deep Boltzman machines Paper by : R. Salakhutdinov, G. Hinton Presenter : Roozbeh Gholizadeh.
CSC2535: 2013 Advanced Machine Learning Lecture 3a: The Origin of Variational Bayes Geoffrey Hinton.
Collaborative Filtering Matrix Factorization Approach
Binary Variables (1) Coin flipping: heads=1, tails=0 Bernoulli Distribution.
PATTERN RECOGNITION AND MACHINE LEARNING
How to do backpropagation in a brain
Boltzmann Machines and their Extensions S. M. Ali Eslami Nicolas Heess John Winn March 2013 Heriott-Watt University.
Using Fast Weights to Improve Persistent Contrastive Divergence Tijmen Tieleman Geoffrey Hinton Department of Computer Science, University of Toronto ICML.
CSC2535: Computation in Neural Networks Lecture 11: Conditional Random Fields Geoffrey Hinton.
CSC321: Neural Networks Lecture 12: Clustering Geoffrey Hinton.
CIAR Second Summer School Tutorial Lecture 1b Contrastive Divergence and Deterministic Energy-Based Models Geoffrey Hinton.
Learning Lateral Connections between Hidden Units Geoffrey Hinton University of Toronto in collaboration with Kejie Bao University of Toronto.
Training Restricted Boltzmann Machines using Approximations to the Likelihood Gradient Tijmen Tieleman University of Toronto (Training MRFs using new algorithm.
CSC Lecture 8a Learning Multiplicative Interactions Geoffrey Hinton.
CSC321: 2011 Introduction to Neural Networks and Machine Learning Lecture 11: Bayesian learning continued Geoffrey Hinton.
Data Mining Practical Machine Learning Tools and Techniques Chapter 4: Algorithms: The Basic Methods Section 4.6: Linear Models Rodney Nielsen Many of.
Geoffrey Hinton CSC2535: 2013 Lecture 5 Deep Boltzmann Machines.
CSC321: 2011 Introduction to Neural Networks and Machine Learning Lecture 9: Ways of speeding up the learning and preventing overfitting Geoffrey Hinton.
CS 782 – Machine Learning Lecture 4 Linear Models for Classification  Probabilistic generative models  Probabilistic discriminative models.
CSC321: Neural Networks Lecture 24 Products of Experts Geoffrey Hinton.
CSC 2535 Lecture 8 Products of Experts Geoffrey Hinton.
Training Restricted Boltzmann Machines using Approximations to the Likelihood Gradient Tijmen Tieleman University of Toronto.
CSC2535 Lecture 4 Boltzmann Machines, Sigmoid Belief Nets and Gibbs sampling Geoffrey Hinton.
CSC321: Introduction to Neural Networks and Machine Learning Lecture 18 Learning Boltzmann Machines Geoffrey Hinton.
CSC321 Introduction to Neural Networks and Machine Learning Lecture 3: Learning in multi-layer networks Geoffrey Hinton.
Neural Networks - Berrin Yanıkoğlu1 Applications and Examples From Mitchell Chp. 4.
CSC321: Lecture 7:Ways to prevent overfitting
Machine Learning 5. Parametric Methods.
Giansalvo EXIN Cirrincione unit #4 Single-layer networks They directly compute linear discriminant functions using the TS without need of determining.
CSC321: Introduction to Neural Networks and Machine Learning Lecture 17: Boltzmann Machines as Probabilistic Models Geoffrey Hinton.
CSC321 Lecture 24 Using Boltzmann machines to initialize backpropagation Geoffrey Hinton.
CSC 2535: Computation in Neural Networks Lecture 10 Learning Deterministic Energy-Based Models Geoffrey Hinton.
CSC Lecture 23: Sigmoid Belief Nets and the wake-sleep algorithm Geoffrey Hinton.
CSC321 Lecture 27 Using Boltzmann machines to initialize backpropagation Geoffrey Hinton.
Combining Models Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya.
CSC321: Neural Networks Lecture 9: Speeding up the Learning
Machine Learning Supervised Learning Classification and Regression
Some Slides from 2007 NIPS tutorial by Prof. Geoffrey Hinton
Regularization Techniques in Neural Networks
Learning Deep Generative Models by Ruslan Salakhutdinov
Deep Feedforward Networks
Energy models and Deep Belief Networks
CSC321: Neural Networks Lecture 22 Learning features one layer at a time Geoffrey Hinton.
Restricted Boltzmann Machines for Classification
Generative Adversarial Networks
CSC321: Neural Networks Lecture 19: Boltzmann Machines as Probabilistic Models Geoffrey Hinton.
Multimodal Learning with Deep Boltzmann Machines
10701 / Machine Learning.
Machine Learning Today: Reading: Maria Florina Balcan
Collaborative Filtering Matrix Factorization Approach
Where did we stop? The Bayes decision rule guarantees an optimal classification… … But it requires the knowledge of P(ci|x) (or p(x|ci) and P(ci)) We.
10701 / Machine Learning Today: - Cross validation,
Chap. 7 Regularization for Deep Learning (7.8~7.12 )
Artificial Neural Networks
Regulation Analysis using Restricted Boltzmann Machines
Deep Learning for Non-Linear Control
Model generalization Brief summary of methods
Parametric Methods Berlin Chen, 2005 References:
CSC2535: 2011 Lecture 5a More ways to fit energy-based models
Introduction to Neural Networks
CSC 578 Neural Networks and Deep Learning
Presentation transcript:

A Practical Guide to Training Restricted Boltzmann Machines Version 1 Georey Hinton Department of Computer Science, University of Toronto

Introduction lRBM has been used in abeled or unlabeled images windows of mel-cepstral coefficients that represent speech bags of words that represent documents user ratings of movies

Introduction(cont.) usually trained using the contrastive divergence learning procedure requires a certain amount of practical experience to decide how to set the values of numerical meta-parameters learning rate, momentum, weight-cost, sparsity target, initial values of the weights, number of hidden units the size of each mini-batch.

Introduction (cont.) RBMs typically learn better models if more steps of alternating Gibbs sampling are used before collecting the statistics for the second term in the learning rule, which will be called the negative statistics CDn will be used to denote learning using n full steps of alternating Gibbs sampling

How to collect statistics when using Contrastive Divergence Updating the hidden states The probability of turning on a hidden unit, j, is computed by the hidden unit turns on if this probability is greater than a random number uniformly distributed between 0 and 1. For the last update of the hidden units, it is silly to use stochastic binary states because nothing depends on which state is chosen. So use the probability itself to avoid unnecessary sampling noise. Updating the visible states

How to collect statistics when using Contrastive Divergence(cont.) Collecting the statistics needed for learning Assuming visible units use real-valued probabilities instead of stochastic binary values, there are two ways to collect the positive statistics for connection between visible unit i and hidden unit j A recipe for getting the learning signal for CD1 When hidden units are driven by data, always use stochastic binary states. When driven by reconstructions, always use probabilities without sampling Assuming the visible units use the logistic function, use probabilities for both the data and the reconstructions. When collecting the pairwise statistics for learning weights or the individual statistics for learning biases, use the probabilities

The size of a mini-batch it is often more efficient to divide the training set into small "mini-batches" of 10 to 100 cases A recipe for dividing the training set into mini-batches For datasets that contain a small number of equiprobable classes, the ideal mini-batch size is often equal to the number of classes For other datasets, first randomize the order of the training examples then use minibatches of size about 10

Monitoring the progress of learning Due to the noise in the gradient estimates, the reconstruction error on the individual mini-batches will fluctuate gently after the initial rapid descent decreases in reconstruction error do not necessarily mean that the model is improving and, conversely, small increases do not necessarily mean the model is getting worse A recipe for using the reconstruction error use multiple histograms and graphic displays using Annealed Importance Sampling to estimate the density

Monitoring the overfitting A recipe for monitoring the overfitting compute the average free energy of a representative subset of the training data and compare it with the average free energy of a validation set If the gap starts growing, the model is overfitting

The learning rate A recipe for setting the learning rates for weights and biases look at a histogram of the weight updates and a histogram of the weights.The updates should be about 10-3 times the weights Conversely, for biases, the updates can be bigger.

The initial values of the weights and biases Using larger random values can speed the initial learning, but it may lead to a slightly worse final model A recipe for setting the initial values of the weights and biases Use small random values for the weights chosen from a zero-mean Gaussian with a standard deviation of 0.01 Set the hidden biases to 0. Set the visible biases to log[pi/(1-pi)] where pi is the proportion of training vectors in which unit i is on

Momentum simple method for increasing the speed of learning when the objective function contains long, narrow and fairly straight ravines The momentum method causes the parameters to move in a direction that is not the direction of steepest descent, so it bears some resemblance to methods like conjugate gradient

momentom(cont.) It is equivalent to increasing the learning rate by a factor of 1/(1-alpha) but delaying the full effect of each gradient estimate by dividing the full increment into a series of exponentially decaying installments. A recipe for using momentum Start with a momentum of 0.5. Once the large initial progress in the reduction of the reconstruction error settled down to gentle progress, increase the momentum to 0.9. This shock may cause a transient increase in reconstruction error. If this causes a more lasting instability, keep reducing the learning rate by factors of 2 until the instability disappears.

Weight-decay Weight-decay works by adding an extra term to the normal gradient four dierent reasons for using weight-decay in an RBM improve generalization to new data by reducing overfitting to the training data. make the receptive fields of the hidden units smoother and more interpretable by shrinking useless weights "unstick" hidden units that have developed very large weights early in the training improve the mixing rate of the alternating Gibbs Markov chain

weight-decay(cont.) A recipe for using weight-decay sensible values for the weight-cost coecient for L2 weight-decay typically range from 0.01 to 0.00001 Try an initial weight-cost of 0.0001 weight-decay does more than just preventing overfitting. It also increases the mixing ratewhich makes CD learning a better approximation to maximum likelihood.

Encouraging sparse hidden activities Sparse activities of the binary hidden units can be achieved by specifying a "sparsity target" which is the desired probability of being active, p << 1 An additional penalty term is then used to encourage the actual probability of being active, q, to be close to p A recipe for sparsity Set the sparsity target to between 0'01 and 0.1. Set the decay-rate, lamda, of the estimated value of q to be between 0.9 and 0.99

The number of hidden units A recipe for choosing the number of hidden units If you are using a sparsity target that is very small, you may be able to use more hidden units. If the training cases are highly redundant, as they typically will be for very big training sets, you need to use fewer parameters.

Different types of unit Softmax and multinomial units For a binary unit, the probability of turning on is given by the logistic sigmoid function of its total input, x. This is often called a "softmax" unit. A further generalization of the softmax unit is to sample N times from the probability distribution. The K different states can then have integer values bigger than 1, but the values must add to N. This is called a multinomial unit

Different types of unit(cont.) Gaussian visible units The energy function then becomes: where sigma_i is the standard deviation of the Gaussian noise for visible unit i The learning rate needs to be about one or two orders of magnitude smaller than when using binary visible units

Different types of unit(cont.) Gaussian visible and hidden units The individual activities are held close to their means by quadratic "containment" terms with coefficients determined by the standard deviations of the assumed noise levels:

Different types of unit(cont.) Binomial units A simple way to get a unit with noisy integer values in range 0 to N is to make N separate copies of a binary unit and give them the same weights and bias. all copies receive the same total input, they all have the same probability, p, of turning on and this only to be computed once The expected number that are on is Np and the variance in this number is Np(1-p). For small p, this acts like a Poisson unit, but as p approaches 1 the variance becomes small again which may not be desireable.

Different types of unit(cont.) Rectified linear units All copies still have the same learned weight vector w and the same learned bias, b, but each copy has a different, fixed offset to the bias. If the offsets are -0.5,-1.5,-2.5, ...,-(N -0:5) the sum of the probabilities of the copies is extremely close to having a closed form: where x = vwT + b.

Varieties of contrastive divergence CD1 CD1 is not a very good approximation to maximum likelihood learning If the aim is to learn an RBM that is a good density or joint-density model, CD1 is far from optimal. persistent contrastive divergence we keep track of the states of a number of persistent chains or "fantasy particles". The learning signal is then the difference between the pairwise statistics measured on a mini- batch of data and the pairwise statistics measured on the persistent chains.

Displaying what is happening during learning Histograms of the following three: the weights, the visible biases the hidden biases

Using RBM's for discrimination three obvious ways of using RBMs for discrimination: use the hidden features learned by the RBM as the inputs for some standard discriminative method train a separate RBM on each class The log probability that the RBM trained on class c assigns to the test vector is given by: t test vector where Zc is the partition function of that RBM. train a joint density model using a single RBM that has two sets of visible units

Using RBM's for discrimination Computing the free energy of a visible vector The free energy of visible vector v is the energy that a single con guration would need to have in order to have the same probability as all of the con gurations that contain v It is also given by the expected energy minus the entropy A good way to compute F(v) is to use yet another expression for the free energy:

Dealing with missing values when learning a joint density for data in which each training case is composed of a vector v such as an image plus a single discrete label. If the label is missing from a subset of the cases, it can be Gibbs sampled from its exact conditional distribution. pretend the missing value inexist by using RBM's with different numbers of visible units in different training cases. The RBMs form a family with shared weights. Each RBM do correct inference for its hidden states, their tying of the weights means they may not be ideal for any particular RBM. Add a visible unit for a missing value and performing correct inference integrating out missing value