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
| """ | |
| Single File implementation of cross-model single layer crosscoder training inspired by | |
| https://github.com/jkminder/dictionary_learning and https://github.com/saprmarks/dictionary_learning | |
| Supports training multiple crosscoders on the same inputs and collect activations in a buffer. | |
| """ | |
| import torch.nn as nn | |
| import torch as th |
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
| import subprocess | |
| import sys | |
| import os | |
| import glob | |
| from argparse import ArgumentParser | |
| def create_git_tag(version): | |
| tag_name = f"v{version}" | |
| result = subprocess.run(["git", "tag", tag_name]) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| """ | |
| A minimal pytorch implementation of a multi-head attention transformer inspired by nanoGPT | |
| """ | |
| from dataclasses import dataclass | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| import torch as th | |
| import numpy as np | |
| class SelfAttention(nn.Module): |
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
| import sys | |
| import math | |
| import numpy as np | |
| REST = "REST" | |
| WAIT = "WAIT" | |
| # Auto-generated code below aims at helping you parse | |
| # the standard input according to the problem statement. |