Skip to content

Instantly share code, notes, and snippets.

View carlthome's full-sized avatar
🎼
Training deep learning models

Carl Thomé carlthome

🎼
Training deep learning models
View GitHub Profile
@carlthome
carlthome / Encode and decode example with T5.ipynb
Last active September 24, 2023 22:14
Encode and decode example with T5.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@carlthome
carlthome / Proximal Policy Optimization (PPO) of the CartPole problem with PyTorch.ipynb
Last active August 20, 2023 21:11
Proximal Policy Optimization (PPO) of the CartPole problem with PyTorch
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@carlthome
carlthome / shell.nix
Last active July 2, 2023 20:12
mir_eval from nixpkgs example shell
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
packages = [
(pkgs.python3.withPackages (ps: with ps; [
ipython
mir_eval
]))
];
shellHook = ''
ipython -c 'import mir_eval; print(mir_eval.__version__)'
@carlthome
carlthome / Lagrange polynomial interpolation.ipynb
Last active August 20, 2023 21:11
Lagrange polynomial interpolation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@carlthome
carlthome / create_jupyter_kernel.sh
Created June 15, 2023 11:47
Create a torchaudio compatible Python 3.8 Jupyter kernel for Vertex AI managed notebooks
conda create -y -c conda-forge -n py38 python=3.8 ipykernel ipywidgets 'ffmpeg<5'
conda run -n py38 ipython kernel install --name py38 --user
@carlthome
carlthome / clone_gists_for_user.py
Last active June 5, 2022 11:27
Clone all gists for a given user.
"""Clone all gists repos for user."""
import argparse
import json
from multiprocessing.dummy import Pool
from pathlib import Path
from subprocess import call
from urllib.request import urlopen
def pull(gist):
@carlthome
carlthome / GPT-3 MIDI sequence autocompletion toy example.ipynb
Created May 21, 2022 16:56
Naively encoding MIDI events to a text representation, to autogenerate melodies from a prompt melody with GPT-3.
Sorry, this is too big to display.
@carlthome
carlthome / docker-compose.yaml
Created January 28, 2022 09:51
Check that a host system can use NVIDIA GPUs inside containers. Usage: `docker-compose run test-gpu`
version: "3"
services:
test-gpu:
image: tensorflow/tensorflow:latest-gpu
command: python -c "import tensorflow as tf; assert tf.test.is_gpu_available()"
deploy:
resources:
reservations:
devices:
- driver: nvidia
@carlthome
carlthome / Zero-copy data sharing between JAX and TensorFlow via DLPack.ipynb
Last active August 20, 2023 21:11
Zero-copy data sharing between JAX and TensorFlow via DLPack
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.