Skip to content

Instantly share code, notes, and snippets.

View amoudgl's full-sized avatar

Abhinav Moudgil amoudgl

View GitHub Profile
@amoudgl
amoudgl / hello-gpt.py
Last active May 30, 2025 18:38
modula GPT tutorial script with seed exposed as a command line argument
"""
Adapted from modula's Hello GPT tutorial:
https://github.com/modula-systems/modula/blob/ede2ba72a1b9de3e1f44156db058b5c32c682941/examples/hello-gpt.ipynb
This script simply exposes dataloader seed as command line argument to test
training sensitivity to seed.
Usage:
python hello-gpt.py --seed 0
@amoudgl
amoudgl / output.log
Created May 30, 2025 17:10
Sweeping over dataloader seed in modula hello GPT tutorial from 0 to 100
Input shape: (12, 64)
Target shape: (12, 64)
First input sequence: [41 53 50 42 1 40 50 53 53 42] ...
First target sequence: [53 50 42 1 40 50 53 53 42 1] ...
Decoded input: cold blood no spark of honour bides.
NORTHUMBERLAND:
Be thou a
@amoudgl
amoudgl / hello-gpt-nan.ipynb
Last active May 30, 2025 17:56
NaNs in modula hello GPT tutorial
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@amoudgl
amoudgl / tx_lopt.py
Last active January 3, 2024 14:38
Code for our ICML23W paper "Learning to Optimize with Recurrent Hierarchical Transformers"
# Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@amoudgl
amoudgl / dummyfig.tex
Created May 12, 2021 03:40 — forked from dpgettings/dummyfig.tex
Fancy placeholder figures in LaTeX
%% This part goes in preamble
\newcommand{\dummyfig}[1]{
\centering
\fbox{
\begin{minipage}[c][0.33\textheight][c]{0.5\textwidth}
\centering{#1}
\end{minipage}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@amoudgl
amoudgl / setup_visdom.md
Last active July 4, 2023 11:27
Setup Visdom on Remote Server

Setup Visdom on Remote Server

Install visdom on your local system and remote server.

pip3 install visdom

On remote server, do:

@amoudgl
amoudgl / README.md
Last active April 17, 2024 06:25
TLP benchmark
@amoudgl
amoudgl / deep-qlearning.py
Created March 30, 2017 09:16
Deep Q-learning for Frozenlake OpenAI gym environment
# simple neural network implementation of qlearning
import gym
from gym import wrappers
import numpy as np
import tensorflow as tf
# build environment
env = gym.make("FrozenLake-v0")
env = wrappers.Monitor(env, '/tmp/frozenlake-qlearning', force=True)
n_obv = env.observation_space.n
# monte carlo policy gradient algorithm
# use neural network to decide the policy
# from observations and rewards, update the parameters of the neural networks to optimize the policy
import numpy as np
import tensorflow as tf
import gym
from gym import wrappers
# initialize constants