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)

Metadata

Release files for xbob.mlp.lbfgs 0.1d

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 0.1d
File Size Uploaded Provenance
xbob.mlp.lbfgs-0.1d.zip 21.4 kB Without provenance Details

Release files / xbob.mlp.lbfgs-0.1d.zip

Download URL xbob.mlp.lbfgs-0.1d.zip
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4238b1b794ca56eaa63a89fbe12c6e602dc97620ff9b15983f0e669cc07d522f
BLAKE2b-256 checksum
How to use checksums
57d069498316a88a88c42bd2923f173d9839de1881e1cde6eb5856d841b97727
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for xbob.mlp.lbfgs 0.1d

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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