Skip to content

Instantly share code, notes, and snippets.

Branch

git branch             # list local branches
git branch -r          # list remote branches
git branch -a          # list all branches

git branch -d branch_name       # delete local branch (merged)
git branch -D branch_name       # force delete local branch
@cameron-chen
cameron-chen / viz_torch_weight.py
Created September 16, 2022 08:54
A gist for visualizing the model weights for PyTorch.
import matplotlib.pyplot as plt
import torch
def viz_weight_norm(
model: torch.nn.Module,
norm_type: float = 2.0,
lay_names: Optional[Sequence[str]] = None,
style_use: str = 'seaborn-deep',
):
"""Visualize weight norms of a model.