Skip to content

Instantly share code, notes, and snippets.

View Butanium's full-sized avatar

Clement Dumas Butanium

View GitHub Profile
@Butanium
Butanium / femtoGPT.py
Last active February 1, 2024 12:58
femtoGPT
"""
A minimal pytorch implementation of a multi-head attention transformer inspired by nanoGPT
"""
from dataclasses import dataclass
import torch.nn as nn
import torch.nn.functional as F
import torch as th
import numpy as np
class SelfAttention(nn.Module):
@Butanium
Butanium / fall-challenge-2020_Irma.py
Created February 1, 2021 20:31
codinGame fall challenge 2020
import sys
import math
import numpy as np
REST = "REST"
WAIT = "WAIT"
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.