Time Period: 2024-04-30 to 2024-05-07
Period Average: 30 per day
Monthly Average: 27 per day
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
# Imports for Annotations | |
from torch.nn import Module | |
from torch.optim import Optimizer | |
from typing import Optional, Union, List | |
def get_layers(model:Module, rgrad:bool=False): | |
""" | |
Returns all layers of the model | |
that have no children ie will return the | |
contents of a sequential but not the Sequential |
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
/// Run using | |
/// ```bash | |
/// zig run -O ReleaseFast fast_zeros.zig > /dev/null | |
/// ``` | |
/// This program writes 0s to std out using a buffer. | |
/// Time taken, buffer size and number of loops are | |
/// written to stderr. | |
/// | |
/// Purpose of this is to roughly check what size of | |
/// buffer allows for max throughput by measuring the |
I often find myself getting frustrated with code—be it code written by me or by others. This, I find, is because that particular code disregards readability.
This frustration of mine often bubbles up in the form of colorfully disparaging commit messages. I decided that it would be more productive to instead type-down what I feel are some decent coding practices.
I've added examples where applicable and tried to explain the why behind the practices.
This document is prone to recency bias. The practices here come to mind because