Skip to content

Instantly share code, notes, and snippets.

View SnailWalkerYC's full-sized avatar
🏠
Working from home

Crazy Walker SnailWalkerYC

🏠
Working from home
View GitHub Profile
@facontidavide
facontidavide / factory.cpp
Last active November 16, 2022 09:16
Factory pattern in C++
#include <iostream>
#include <unordered_map>
#include <functional>
#include <vector>
// Base class
class Shape {
public:
virtual void draw() = 0;
};
@karpathy
karpathy / min-char-rnn.py
Last active March 27, 2024 21:13
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)