(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
""" | |
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) |
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
from abc import ABC | |
from abc import abstractmethod | |
from abc import abstractproperty | |
from dataclasses import dataclass, field | |
from typing import Any | |
from typing import AsyncGenerator | |
from typing import Awaitable | |
from typing import Callable | |
from typing import Generator | |
from typing import Generic |
#!/usr/bin/env python3 | |
import zipfile | |
import sys | |
import re | |
import xml.etree.ElementTree as ET | |
namespaces = { | |
'a': 'http://schemas.openxmlformats.org/drawingml/2006/main', | |
'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships', |
import torch | |
def jacobian(y, x, create_graph=False): | |
jac = [] | |
flat_y = y.reshape(-1) | |
grad_y = torch.zeros_like(flat_y) | |
for i in range(len(flat_y)): | |
grad_y[i] = 1. | |
grad_x, = torch.autograd.grad(flat_y, x, grad_y, retain_graph=True, create_graph=create_graph) | |
jac.append(grad_x.reshape(x.shape)) |
class Counter: | |
def __init__(self, n=3) -> None: | |
self.n = n | |
self._cnt = 0 | |
def __await__(self): | |
for _ in range(self.n): | |
r = yield self._cnt | |
print(f"incrementing by {r}") |