Skip to content

Instantly share code, notes, and snippets.

View afspies's full-sized avatar
🐐

Alex Spies afspies

🐐
View GitHub Profile
@afspies
afspies / configlib.py
Last active January 17, 2021 17:39 — forked from nuric/configlib.py
"""Configuration library for experiments.
Based on version by Nuri C. https://gist.github.com/nuric/e9df5e38c34c804ec6c298ffca7e2d9b
-- USAGE --
In Header:
import config.configlib as configlib
from config.configlib import config as C
parser = configlib.add_parser("File Spec Config")
parser.add_argument("--mlp_size", default=128, type=int, help="Size of Output MLP")
@afspies
afspies / set_seed.py
Last active April 13, 2022 13:30 — forked from rish-16/tf_seed.py
Experiment Seeding for GPUs
import os
import numpy as np
import random
import tensorflow as tf
# from tfdeterminism import patch - only in older versions (<2?) of Tensorflow
# import torch
def seed(seed=42):
@afspies
afspies / printarr
Last active February 26, 2023 11:23 — forked from nmwsharp/printarr
Pretty print tables summarizing properties of tensor arrays in numpy, pytorch, jax, etc.
Pretty print tables summarizing properties of tensor arrays in numpy, pytorch, jax, etc.