Skip to main content

Flambé


Fast tests Slow tests Documentation Status PyPI version

Welcome to Flambé, a PyTorch-based library that allows users to:

  • Run complex experiments with multiple training and processing stages

  • Search over hyperparameters, and select the best trials

  • Run experiments remotely over many workers, including full AWS integration

  • Easily share experiment configurations, results, and model weights with others

Installation

From PIP:

pip install flambe

From source:

git clone git@github.com:asappresearch/flambe.git
cd flambe
pip install .

Getting started

Define an Experiment:

!Experiment

name: sst-text-classification

pipeline:

  # stage 0 - Load the Stanford Sentiment Treebank dataset and run preprocessing
  dataset: !SSTDataset
    transform:
      text: !TextField
      label: !LabelField

  # Stage 1 - Define a model
  model: !TextClassifier
      embedder: !Embedder
        embedding: !torch.Embedding  # automatically use pytorch classes
          num_embeddings: !@ dataset.text.vocab_size
          embedding_dim: 300
        embedding_dropout: 0.3
        encoder: !PooledRNNEncoder
          input_size: 300
          n_layers: !g [2, 3, 4]
          hidden_size: 128
          rnn_type: sru
          dropout: 0.3
      output_layer: !SoftmaxLayer
          input_size: !@ model[embedder][encoder].rnn.hidden_size
          output_size: !@ dataset.label.vocab_size

  # Stage 2 - Train the model on the dataset
  train: !Trainer
    dataset: !@ dataset
    model: !@ model
    train_sampler: !BaseSampler
    val_sampler: !BaseSampler
    loss_fn: !torch.NLLLoss
    metric_fn: !Accuracy
    optimizer: !torch.Adam
      params: !@ train[model].trainable_params
    max_steps: 10
    iter_per_step: 100

  # Stage 3 - Eval on the test set
  eval: !Evaluator
    dataset: !@ dataset
    model: !@ train.model
    metric_fn: !Accuracy
    eval_sampler: !BaseSampler

# Define how to schedule variants
schedulers:
  train: !ray.HyperBandScheduler

All objects in the pipeline are subclasses of Component, which are automatically registered to be used with YAML. Custom Component implementations must implement run to add custom behavior when being executed.

Now just execute:

flambe example.yaml

Note that defining objects like model and dataset ahead of time is optional; it’s useful if you want to reference the same model architecture multiple times later in the pipeline.

Progress can be monitored via the Report Site (with full integration with Tensorboard).

Features

  • Native support for hyperparameter search: using search tags (see !g in the example) users can define multi variant pipelines. More advanced search algorithms will be available in a coming release!

  • Remote and distributed experiments: users can submit Experiments to Clusters which will execute in a distributed way. Full AWS integration is supported.

  • Visualize all your metrics and meaningful data using Tensorboard: log scalars, histograms, images, hparams and much more.

  • Add custom code and objects to your pipelines: extend flambé functionality using our easy-to-use extensions mechanism.

  • Modularity with hierarchical serialization: save different components from pipelines and load them safely anywhere.

Next Steps

Full documentation, tutorials and much more in https://flambe.ai

Contact

You can reach us at flambe@asapp.com

Metadata

Release files for flambe 0.4.18

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

Source distribution (sdist)

Source distribution for flambe 0.4.18
File Size Uploaded Provenance Actions
flambe-0.4.18.tar.gz 166.0 kB Without provenance Details for flambe-0.4.18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flambe 0.4.18
File Interpreter ABI Platform Actions
flambe-0.4.18-py3-none-any.whl Python 3 none any Details for flambe-0.4.18-py3-none-any.whl

Total release size: 386.5 kB

Release files / flambe-0.4.18.tar.gz

Download URL flambe-0.4.18.tar.gz
Size 166.0 kB
Tags Source
SHA-256 checksum
How to use checksums
523aa5afbef530b1fb8916f26b6d6d50a09ae39febbf3583e81d3b4d135d4e6a
BLAKE2b-256 checksum
How to use checksums
096824b55ce89183ba11679349956fdf1ceebcb7093032424367e6647c424426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10

Release files / flambe-0.4.18-py3-none-any.whl

Download URL flambe-0.4.18-py3-none-any.whl
Size 220.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8656b80550f23ebdd27fb48583762fd0a4bcef4aa15cd4a1c659acdcd7fd6452
BLAKE2b-256 checksum
How to use checksums
a9465a84fa944d83f9199b0f48d7e77f9d578a9186995b8494205c295e02e73d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10

Security for flambe 0.4.18

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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