LaTeX indicator function

I always struggle to write an indicator function in Latex. You know, the 1 with a double bar, for instance in 𝟙_A(x). For letters like N, a simple \mathbb{N} gives a nice ℕ, but \mathbb{1} gives a weird looking character that is definitely not a double-struck 1. The best way I found is to import the dsfont package and use \mathds{1}: \usepackage{dsfont} \mathds{1} It’s also possible to import the bbm package and use \mathbbm{1}, but I don’t recommend this option as it uses a bitmapped font for the 𝟙 character....

September 21, 2023

Ray cheatsheet

This cheatsheet lists some things I need with Ray and that are a bit hard to find in the documentation. How to restart fail runs in Ray Tune From the docs: # Rerun ONLY failed trials after an experiment is finished. tune.run(my_trainable, config=space, local_dir=<path/to/dir>, resume="ERRORED_ONLY") How to resume an experiment with no name with Ray Tune You can resume checkpointed experiments with ray.tune(name=name, resume=True, ...). If you didn’t specify a name for the experiment you want to resume, Ray assigned a name based on the date and time you launched the experiment, such as run_2021-08-18_02-39....

August 21, 2021

LaTeX: left arrow to sample an element uniformly at random

Here is a command to draw a left arrow with a dollar sign. It is commonly used to denote a variable assignment uniformly at random from a given set. LaTeX notation to sample a random elementLaTeX notation to sample a random element $\alpha \overset{{\scriptscriptstyle\$}}{\leftarrow} \mathbb{G}$ Some people use the letter R instead of the dollar sign $. Here are a few variants: LaTeX notation to sample a random element (variants)LaTeX notation to sample a random element (variants)...

April 14, 2021