Get started in the cloud environment

Our alpha users have access to the OPU Zeus, Vulcain and Saturn respectively through our servers k1, k2 and k3 at OVH.

First connection to cloud’s servers

Create SSH key

SSH key are used to authenticate your computer against the machine hosting the OPU. If you already have one that is protected with a passphrase, you can skip this step.

  • Open Terminal (or Git Bash, if on Windows)

  • Create SSH key: ssh-keygen -t rsa -b 4096

  • When you’re prompted to “Enter a file in which to save the key,” press Enter. This accepts the default file location.

  • At the prompt, type a secure passphrase (Don’t leave the passphrase empty!).

  • Get your SSH public key: copy-paste the content of ~/.ssh/ with less ~/.ssh/

  • Send to your SSH public key (never communicate your private key!) for account creation.

See also this GitHub tutorial.

If the SSH key is refused

On some systems the SSH key needs to be activated every time you launch a new terminal. It’s not the case on Ubuntu.

  • Start ssh-agent: ssh-agent /bin/bash

  • Add SSH key to ssh-agent: ssh-add ~/.ssh/id_rsa

  • Enter the passphrase of your key

Connecting to our servers

Connect to the server with: ssh -A The -A option allows to forward your SSH identity from your local machine to k1, so that you don’t have to register it again on other remotes. To connect to other machines replace k1 with their name (k2 or k3).

Replace “username” by the name of the account LightOn gave you on the server.

Once you login, you will be asked a new password.


On Windows machine, don’t use PuTTY, but Git Bash (unless you used PuTTY to create your SSH key pair).

Python virtualenv

A Python 3.5 virtualenv has been created for you and is active. It is recommended to use it as it already contains LightOn’s libraries lightonopu and lightonml. You can add other packages to the virtual environment with the command pip install name-of-module. In case you want to make your own virtualenv, go to Virtual Environments.


You might need to update lightonml or lightonopu libraries. You can do it with the following command: pip install -f /usr/local/lighton/wheels lightonml -U and pip install -f /usr/local/lighton/wheels lightonopu -U

Jupyter server

A Jupyter server is available at https://<server-name> on your browser. You can login with your username and password of that server.

When you create a Jupyter Notebook, in New, you need to pick Python 3 (LightOn OPU) to use opu-venv virtual environment. In case you have picked Python 3, you need to switch your kernel in Kernel, Change kernel, Python 3 (LightOn OPU) in your notebook.

Available datasets

Many datasets are already available on our servers, you can find them in /data1/mldata (on k1) or /data/mldata (on the other servers).

List of datasets that can be loaded with the lightonml.datasets module:


  • FashionMNIST

  • SignMNIST

  • CIFAR10

  • CIFAR100

  • STL10

ImageNet, PASCAL-VOC2012 and LSUN are inside the same directory, but we don’t offer any loader for them in lightonml. You can use ones from other machine learning framework, such as PyTorch, or write your own data loader.

If you are interested or need other datasets you can send us a request.

Using the OPU


Before using the OPU, you need to book a time slot on the web page Please note that the field username must be filled with the username used to connect to the server. You won’t be able to connect to the OPU if you don’t fill correctly this field.

Testing the OPU

This is a self-contained script that is runnable on the OPU to test that everything is installed correctly:

from lightonml.projections.sklearn import OPUMap
from lightonml.datasets import MNIST
from lightonml.encoding.base import BinaryThresholdEncoder

# load data
(_, _), (X, _) = MNIST()
# encode data
encoder = BinaryThresholdEncoder()
X_encoded = encoder.transform(X)
# initialize opu objects
mapping = OPUMap(n_components=10000)
# get random features
random_features = mapping.transform(X_encoded)
print("Successfully projected {} samples using the OPU.".format(len(X)))


Do not forget to free the OPU at the end of your booking by doing Close and Halt on your Jupyter Notebook.