Skip to main content

L-BFGS-based trainer for the MLP machine of Bob

Project description

This example demonstrates how to extend Bob by providing a new L-BFGS-based trainer for the multilayer perceptron (MLP) implementation of Bob.

Installation

First, you have to install bob following the instructions there.

There are two options you can follow to get this package installed and operational on your computer: you can use automatic installers like pip (or easy_install) or manually download, unpack and use zc.buildout to create a virtual work environment just for this package. In both cases, the two dependences listed above will be automatically downloaded and installed.

Using an automatic installer

Using pip is the easiest (shell commands are marked with a $ signal):

$ pip install xbob.mlp.lbfgs

You can also do the same with easy_install:

$ easy_install xbob.mlp.lbfgs

This will download and install this package plus any other required dependencies. It will also verify if the version of Bob you have installed is compatible.

This scheme works well with virtual environments by virtualenv or if you have root access to your machine. Otherwise, we recommend you use the next option.

Using zc.buildout

Download the latest version of this package from PyPI and unpack it in your working area. The installation of the toolkit itself uses buildout. You don’t need to understand its inner workings to use this package. Here is a recipe to get you started:

$ python bootstrap.py
$ ./bin/buildout

These two commands should download and install all non-installed dependencies and get you a fully operational test and development environment.

User Guide

It is assumed you have followed the installation instructions for the package and got this package installed.

Below, we provide an example of how to train an MLP using this trainer, from the python universe:

>>> machine = bob.machine.MLP((n_inputs, n_hidden, n_outputs))
>>> # Initialize the machine weights/biases as wished
>>> trainer = xbob.mlp.lbfgs.Trainer(1e-6)
>>> trainer.initialize(machine)
>>> trainer.train(machine, X, labels)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xbob.mlp.lbfgs-1.0.0.zip (20.7 kB view details)

Uploaded Source

File details

Details for the file xbob.mlp.lbfgs-1.0.0.zip.

File metadata

  • Download URL: xbob.mlp.lbfgs-1.0.0.zip
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xbob.mlp.lbfgs-1.0.0.zip
Algorithm Hash digest
SHA256 299bd56b77bf27723eaf49c5d50a81b7492fedb8e31e4ca8b4ddb58056cd8169
MD5 5bd402071d850d3a76b7826acbeba06e
BLAKE2b-256 6fab17d915005864bf42ef1954645a7c9c17c3c8e9aea4a94f3e15744dcaa77a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page