This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"url": "https://calendar.google.com/calendar/ical/a0743f85a7e10fa90a0dabedbc0742ffd67995ae7ad5a8d90ed0ed35efacdf5e%40group.calendar.google.com/public/basic.ics", | |
"title": "ICLP 2023 Schedule", | |
"date": "2023-07-09", | |
"starting_hour": "8", | |
"ending_hour": "20", | |
"hour_division": "2", | |
"target": "_self", | |
"start_of_week": "su", | |
"timezone": "Europe/London", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pretty print tables summarizing properties of tensor arrays in numpy, pytorch, jax, etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Color definitions to override the quiver web color scheme with matplotlib colors defined as tex macros | |
// This allows easy creation of stylistically consistent Tikz diagrams with relative ease |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EDIT 10/04/2022 - This version was provided by @jayelm who fixed some bugs and made the function much more robust | |
import os | |
import subprocess | |
import time | |
def assign_free_gpus(threshold_vram_usage=1500, max_gpus=2, wait=False, sleep_time=10): | |
""" | |
Assigns free gpus to the current process via the CUDA_AVAILABLE_DEVICES env variable | |
This function should be called after all imports, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Originally taken from Xander Steenbrugge | |
# cv2: | |
height, width, _ = img.shape | |
img_resized = cv2.resize(img, (new_width, new_height)) | |
img_pixel_values = img[top:down, left:right, :] | |
# PIL | |
width, height = img.size | |
img_resized = img.resize((new_width, new_height)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Light Mode | |
{ | |
"customColorSchemes": [[ | |
{"fill": "#2282bc", "stroke": "none"}, // blue | |
{"fill": "#17c6d5", "stroke": "none"}, // cyan | |
{"fill": "#c4c526", "stroke": "none"}, // yellow | |
{"fill": "#e782c9", "stroke": "none"}, // pink | |
{"fill": "#9e72c5", "stroke": "none"}, // purple | |
{"fill": "#db2c2d", "stroke": "none"}, // red | |
{"fill": "#32aa32", "stroke": "none"}, // green |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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") |