Skip to content

Instantly share code, notes, and snippets.

🌍
AI vs Climate Change

Victor Schmidt vict0rsch

🌍
AI vs Climate Change
View GitHub Profile
@vict0rsch
vict0rsch / milacheatsheet.md
Last active Jun 18, 2020
Mila's cluster cheat sheet
View milacheatsheet.md

Mila Cluster Cheat Cheat

This is merely an introduction to get you started quickly. This does not replace Mila's official cluster documentation => docs.mila.quebec which you should definitely go through, thoroughly before you start using the cluster.

Before starting: get your Mila cluster account ready. Should look something like surname[:6]firstname[0] but this may vary, it’s not a necessary condition.

View doudou-web.md
View parse_clusterconf.py
from pathlib import Path
import re
from rstcloth.rstcloth import RstCloth
if __name__ == "__main__":
conf = Path() / "conf.txt"
clusterdest = Path() / "clusterconf.rst"
clouddest = Path() / "cloudconf.rst"
with conf.open("r") as f:
lines = [l.strip() for l in f.readlines()]
View keybindings.json
[
{
"key": "ctrl+shift+left",
"command": "workbench.action.previousEditor"
},
{
"key": "ctrl+alt+cmd+5",
"command": "-workbench.action.previousEditor"
},
{
View log trace.txt
[Info - 11:44:14 PM] Analysis cache path: /Users/victor/Library/Caches/Microsoft/Python Language Server
[Info - 11:44:14 PM] Microsoft Python Language Server version 0.5.10.0
[Info - 11:44:14 PM] Workspace root: /Users/victor/Documents/Experiments/torch
[Info - 11:44:14 PM] GetCurrentSearchPaths /Users/victor/Documents/Experiments/torch/nndebug/bin/python
[Info - 11:44:14 PM] Interpreter search paths:
[Info - 11:44:14 PM] /Users/victor/.pyenv/versions/3.6.9/lib/python3.6
[Info - 11:44:14 PM] /Users/victor/.pyenv/versions/3.6.9/lib/python3.6/lib-dynload
[Info - 11:44:14 PM] /Users/victor/Documents/Experiments/torch/nndebug/lib/python3.6/site-packages
[Info - 11:44:14 PM] User search paths:
[Info - 11:44:18 PM] Initializing for /Users/victor/Documents/Experiments/torch/nndebug/bin/python
View log-trace.txt
[Info - 1:16:10 PM] Analysis cache path: /Users/victor/Library/Caches/Microsoft/Python Language Server
[Info - 1:16:10 PM] Microsoft Python Language Server version 0.4.127.0
[Info - 1:16:10 PM] Workspace root: /Users/victor/Documents/Experiments/torch
[Info - 1:16:11 PM] GetCurrentSearchPaths /Users/victor/Documents/Experiments/torch/nndebug/bin/python
[Info - 1:16:11 PM] Interpreter search paths:
[Info - 1:16:11 PM] /Users/victor/.pyenv/versions/3.6.9/lib/python3.6
[Info - 1:16:11 PM] /Users/victor/.pyenv/versions/3.6.9/lib/python3.6/lib-dynload
[Info - 1:16:11 PM] /Users/victor/Documents/Experiments/torch/nndebug/lib/python3.6/site-packages
[Info - 1:16:11 PM] User search paths:
[Info - 1:16:14 PM] Initializing for /Users/victor/Documents/Experiments/torch/nndebug/bin/python
View logs.txt
[Info - 5:00:33 PM] Analysis cache path: /Users/victor/Library/Caches/Microsoft/Python Language Server
[Info - 5:00:33 PM] Microsoft Python Language Server version 0.4.114.0
[Info - 5:00:33 PM] Workspace root: /Users/victor/Documents/ccai/github/omnigan
[Info - 5:00:34 PM] GetCurrentSearchPaths /Users/victor/Documents/ccai/github/omnigan/omnienv/bin/python
[Info - 5:00:34 PM] Interpreter search paths:
[Info - 5:00:34 PM] /Users/victor/.pyenv/versions/3.7.4/lib/python3.7
[Info - 5:00:34 PM] /Users/victor/.pyenv/versions/3.7.4/lib/python3.7/lib-dynload
[Info - 5:00:34 PM] /Users/victor/Documents/ccai/github/omnigan/omnienv/lib/python3.7/site-packages
[Info - 5:00:34 PM] User search paths:
[Info - 5:00:37 PM] Initializing for /Users/victor/Documents/ccai/github/omnigan/omnienv/bin/python
@vict0rsch
vict0rsch / labels_to_shields.py
Last active Apr 12, 2019
Produce shields from settings.yml to include as images into Readme.md
View labels_to_shields.py
from pathlib import Path
if __name__ == "__main__":
labels_path = Path() / "labels.yml"
if labels_path.exists():
with labels_path.open() as f:
lines = f.readlines()
shields = []
names = []
i = 1
@vict0rsch
vict0rsch / github_labels_to_yaml_settings.js
Last active Apr 11, 2019
Get all labels + colors + description on your repository's `labels` section into a Project-Bot compatible settings.yml file
View github_labels_to_yaml_settings.js
// Just run this whole script in your browser's console on the appropriate webpage
// For instance on https://github.com/facebook/create-react-app/labels
// 1
var labels = [];
[].slice.call(document.querySelectorAll(".label-link"))
.forEach(function (element) {
labels.push({
name: `"${element.textContent.trim()}"`,
// using style.backgroundColor might returns "rgb(...)"
@vict0rsch
vict0rsch / streaming_multilabel_f1_score.py
Last active Sep 7, 2019
Streaming and Multilabel F1 score in Tensorflow
View streaming_multilabel_f1_score.py
# From my blog post: http://vict0rsch.github.io/2018/06/06/tensorflow-streaming-multilabel-f1/
import tensorflow as tf
import numpy as np
from tensorflow.python.ops import variable_scope
from tensorflow.python.ops import array_ops
from tensorflow.python.framework import ops
from sklearn.metrics import f1_score
You can’t perform that action at this time.