Feyn Documentation

Feyn Documentation

  • Learn
  • Guides
  • Tutorials
  • API Reference
  • FAQ

›Advanced

Getting Started

  • Quick start
  • Using Feyn
  • Installation
  • What is the QLattice?

Essentials

  • Auto Run
  • Summary plot
  • Plot response
  • Splitting a dataset
  • Seeding a QLattice
  • Predicting with a model
  • Saving and loading models
  • Categorical features

Evaluate Regressors

  • Regression plot
  • Residuals plot

Evaluate Classifiers

  • ROC curve
  • Confusion matrix
  • Plot probability scores

Understand Your Models

  • Plot response 1D
  • Plot response 2D
  • Model signal
  • Segmented loss
  • Interactive flow

Primitive Operations

  • Using the primitives
  • Updating priors
  • Sample models
  • Fitting models
  • Pruning models
  • Visualise a model
  • Diverse models
  • Updating a QLattice
  • Validate data
  • Semantic types

Advanced

  • Converting a model to SymPy
  • Logging in Feyn
  • Setting themes
  • Saving a graph as an image
  • Using the query language
  • Estimating priors
  • Filtering models
  • Model parameters
  • Model complexity

Privacy & Commercial

  • Privacy
  • Community edition
  • Commercial use
  • Transition to Feyn 3.0

Setting themes

by: Kevin Broløs
(Feyn version 3.4.0 or newer)


In some situations, such as if you're running in a dark mode editor, or if you're looking to publish your results in a journal, you might want to use a different theme.

Example

import feyn
from feyn import Theme

ql = feyn.QLattice()
models = ql.sample_models(['Hello'], 'World')

We have four themes available: Default, Dark, Monochrome and Monochrome Dark

Default
Dark Mode
Monochrome
Monochrome Dark Mode
Theme.set_theme('default')
models[0]

Light mode


These themes also apply to our plots and graphs. We've made a comparison to the stylesheet reference in matplotlib down below, and also showcase some colormaps that are registered with matplotlib.

Light mode Light mode Light mode

Theme.set_theme('dark')
models[0]

These themes also apply to our plots and graphs. We've made a comparison to the stylesheet reference in matplotlib down below, and also showcase some colormaps that are registered with matplotlib.

Theme.set_theme('mono')
models[0]

Monochrome mode


These themes also apply to our plots and graphs. We've made a comparison to the stylesheet reference in matplotlib down below, and also showcase some colormaps that are registered with matplotlib.

Monochrome mode Monochrome mode Monochrome mode

Theme.set_theme('mono_dark')
models[0]

These themes also apply to our plots and graphs. We've made a comparison to the stylesheet reference in matplotlib down below, and also showcase some colormaps that are registered with matplotlib.


Full list of feyn colormaps: feyn, feyn-diverging, feyn-partial, feyn-primary, feyn-highlight, feyn-secondary, feyn-accent, feyn-signal.

This should help make our graphs a little easier on the eyes in different editors.

Flipping colormaps

Some colormaps, notably feyn-diverging, are used heavily for classification plots where color coding can carry important meaning. For a binary outcome, sometimes 0 is a good outcome and 1 is bad, and other times, it's the opposite. The default ordering is 0 gets the "danger" hues and 1 gets the "safer" hues.

There's a helper function on Theme to flip the order of this colormap, so you can easily control the positive and negative end of the color scale without having to supply a new colormap for each plot you do throughout.

As a shorthand for the diverging colormap:

Theme.flip_diverging_cmap()

which is the colormap used by default in plot_response_2d and plot_probability_scores.

or as a general function that works for all of the feyn colormaps, should you want that:

Theme.flip_cmap("feyn-diverging")

Each time you call the function, the colormap is reversed in order, so calling it twice will revert it to normal.

← Logging in FeynSaving a graph as an image →
  • Example
  • Flipping colormaps

Subscribe to get news about Feyn and the QLattice.

You can opt out at any time, and you can read our privacy policy here.

Copyright © 2024 Abzu.ai - Feyn license: CC BY-NC-ND 4.0
Feyn®, QGraph®, and the QLattice® are registered trademarks of Abzu®