Skip to main content

MLP L-BFGS Trainer for Bob

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)

Release files for xbob.mlp.lbfgs 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xbob.mlp.lbfgs 1.0.3
File Size Uploaded
xbob.mlp.lbfgs-1.0.3.zip 33.0 kB Details

Release files / xbob.mlp.lbfgs-1.0.3.zip

Download URL xbob.mlp.lbfgs-1.0.3.zip
Size 33.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2bdf0fcb1505bdd84f02994290f41eba4422ba19d1dc6dc0337ec74822130659
BLAKE2b-256 checksum
How to use checksums
d8ebd9d5679bccfd0151c63139bdef67c1e3f4c3fe90e4ae76fe3df9194f83f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 release file

1.0.2

1 release file

1.0.1

1.0.0

1 release file

0.1h

1 release file

0.1g

1 release file

0.1f

1 release file

0.1e

1 release file

0.1d

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page