This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple example of manually performing "automatic" differentiation | |
""" | |
import numpy as np | |
from numpy import exp, sin, cos | |
def f(x, with_grad=False): | |
# Need to cache intermediates from forward pass (might not use all of them). | |
a = exp(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.CompilerServices; | |
using static ParsingExtensions; | |
string input = "Name: Andrew; Age: 31"; | |
string? name = null; | |
int age = 0; | |
if (input.TryParse($"Name: {Placeholder(ref name)}; Age: {Placeholder(ref age)}")) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Youtube playlist/video archiver, downloads changes on subsequent run, keeps track in archive.txt file. | |
#Install yt-dlp from pip: pip install yt-dlp --break-system-packages | |
#Reopen terminal, run `sh ytdl.sh https://playlistvideourlhere <optional command>` | |
#Use cookies and remove sleep-interval max-sleep-interval for much faster playlist parsing and speeds. | |
# --cookies ${COOKIES} \ | |
#https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc |