Skip to content

Instantly share code, notes, and snippets.

View granmoe's full-sized avatar
🔔
Maximizing the frame rate, resolution, and screen size of my mind 😑

Matt Granmoe granmoe

🔔
Maximizing the frame rate, resolution, and screen size of my mind 😑
View GitHub Profile
@maxim5
maxim5 / pretrained_word2vec_lstm_gen.py
Last active July 2, 2023 10:40
Text generator based on LSTM model with pre-trained Word2Vec embeddings in Keras
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
__author__ = 'maxim'
import numpy as np
import gensim
import string
// In v2/3 you did this:
import ReactDOM from 'react-dom'
import { Router, browserHistory, Route } from 'react-router'
ReactDOM.render(
<Router>
<Route path="/about" component={About}/>
<Route path="/:username" component={User}/>
</Router>
)
function* runTimer(getState) {
while(yield take('START')) {
while(true) {
const {stop, tick} = yield race({
stop : take('STOP'),
tick : call(wait, ONE_SECOND);
})
if ( !stop ) {
yield put(actions.tick());
@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)
@mxriverlynn
mxriverlynn / 0.js
Last active September 10, 2018 08:33
recursing a tree structure with ES6 generators
function *doStuff(){
yield 1;
yield 2;
yield *doStuff();
}
var it = doStuff();
var res;
res = it.next();