This file contains 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/bash | |
# With some help from ChatGPT, although it was only somewhat correct/helpful | |
rs_name="..." # name of replicaset | |
namespace="..." # namespace to find pod/rs within | |
# Function to tail logs for each pod | |
tail_logs() { | |
local pod="$1" | |
echo "Tailing logs for pod: $pod" |
This file contains 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
class SklearnSerializer: | |
""" | |
Sklearn recommends we use joblib's dump/load commands, but this uses pickle and pickle | |
is a PITA. Numpy's serialization is compact and reliable and performs well across | |
different platforms and versions of Python and joblib. This serializer extracts all | |
the components of each sklearn object that are fitted (assuming sklearn's convention | |
of fitted attributes ending in underscore), and saves them in a numpy .npz file. | |
""" | |
def __init__(self): | |
pass |
This file contains 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
""" | |
Chunk a large XML file consisting of M elements of tag `row` into N JSON blobs | |
which can be read directly into memory | |
""" | |
import math | |
import subprocess | |
from datetime import datetime | |
from dataclasses import dataclass, field | |
from pathlib import Path | |
from typing import Dict |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# call Chain(Dense(2, 400, NNlib.relu), Dense(400, 784, NNlib.σ)) | |
# 100x with random input, where the matmul/add is called "preactiv" | |
# for layers 1 and 2, and the nonlinearities are timed separately. | |
# As always if using sigmoidal transformations, these account for | |
# much of the forward and backward time pass despite being element- | |
# wise operations. | |
#= | |
──────────────────────────────────────────────────────────────────── | |
Time Allocations |
This file contains 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 Statistics | |
using Formatting | |
using Flux.Tracker | |
using Flux.Tracker: update! | |
# Define simple linear model | |
W = param(rand(2, 5)) | |
b = param(rand(2, 1)) |