Active learning in one line
Keep a model
| Concept | Formal core | Intuition for the next query |
|---|---|---|
| Decision-centric | “If I were given the label of |
| # Your init script | |
| # | |
| # Atom will evaluate this file each time a new window is opened. It is run | |
| # after packages are loaded/activated and after the previous editor state | |
| # has been restored. | |
| # | |
| # An example hack to log to the console when each text editor is saved. | |
| # | |
| # atom.workspace.observeTextEditors (editor) -> | |
| # editor.onDidSave -> |
| setup=''' | |
| import numpy as np | |
| import torch | |
| V_nat = [[1, 2], [3, 4]] | |
| U_nat = [[2, -1, 0, 0, 0, 0], | |
| [5, 2, 8, -1, 0, 0]] | |
| def compute_using_fleuret_1(): |
| import torch | |
| import torch.nn as nn | |
| class Sparsemax(nn.Module): | |
| def __init__(self, dim=-1): | |
| super(Sparsemax, self).__init__() | |
| self.dim = dim | |
| def forward(self, x): | |
| # Move the dimension to apply Sparsemax to the front |
| class DistributedIdentity: | |
| """ | |
| Singleton class to hold distributed identity information. | |
| Handles SLURM, torchrun, and local runs. | |
| Looks for the following environment variables: | |
| - RANK | |
| - WORLD_SIZE | |
| - LOCAL_RANK |
| import math | |
| import torch.optim as optim | |
| import torch | |
| from torch import nn | |
| class MineWrapper(nn.Module): | |
| def __init__(self, stat_model, moving_average_rate=0.1, unbiased=False): | |
| super(MineWrapper, self).__init__() |
| tailast() { | |
| # Get the directory from the argument or use the current directory as default | |
| local dir="${1:-.}" | |
| # Find the most recently modified file in the directory without descending into subdirectories | |
| local latest_file=$(find "$dir" -maxdepth 1 -type f -exec stat --format='%Y %n' {} \; | sort -n | tail -1 | awk '{print $2}') | |
| # Check if a file was found | |
| if [[ -z "$latest_file" ]]; then | |
| echo "No files found in $dir" |
| from concurrent.futures import ProcessPoolExecutor | |
| import numpy as np | |
| from scipy.signal import convolve2d | |
| from tqdm import tqdm | |
| nsims = int(1e6) | |
| nevents = int(1e5) | |
| #!/usr/bin/env python3 | |
| """ | |
| textrepo — dump a repository into a single text file, optimized for LLM input. | |
| Features | |
| - Always prints a folder tree of the discovered files (after ignores). | |
| - Emits a per-file section for every *text-eligible* file (even if skipped/truncated). | |
| - Respects .gitignore by default (disable with --no-gitignore). | |
| - Supports extra ignore patterns and an additional ignore file (gitignore-ish). | |
| - Detects and omits binary / non-text files from the per-file sections |
| import matplotlib.pyplot as plt | |
| import networkx as nx | |
| from causallearn.utils.KCI.KCI import KCI_CInd, KCI_UInd | |
| from npeet_plus import mi, mi_pvalue | |
| from tqdm import tqdm | |
| from src.causal_discovery.static_causal_discovery import ( | |
| run_causal_discovery, | |
| visualize_causal_graph, | |
| ) |
Active learning in one line
Keep a model
| Concept | Formal core | Intuition for the next query |
|---|---|---|
| Decision-centric | “If I were given the label of |