MCPcopy Index your code
hub / github.com/ajtejankar/byol-convert

github.com/ajtejankar/byol-convert @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
39 symbols 96 edges 3 files 14 documented · 36%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Convert official BYOL weights to PyTorch

Only supports ResNet-50 for now. Since the augmentation in PyTorch will be slightly different from the orignal, expect some differences in accuracy. I am not entirely sure about why the crop_only is 5 point worse. Original weights from BYOL. This is a basic script which should generally work with most versions of PyTorch and Torchvision, but it's written with PyTorch (1.4) and Torchvision (0.5).

# convert the weights
python convert.py pretrain_res50x1.pkl pretrain_res50x1.pth.tar
# validate the weights
python validate.py pretrain_res50x1.pth.tar /datasets/imagenet/val
Name Original Acc Converted Acc
pretrain_res50x1 74.4 74.6
res50x1_batchsize_2048 72.4 72.3
res50x1_batchsize_1024 72.2 72.3
res50x1_batchsize_512 72.2 72.1
res50x1_batchsize_256 71.8 71.9
res50x1_batchsize_128 69.6 (+- 0.5) 69.7
res50x1_batchsize_64 59.7 (+- 1.5) 58.2
res50x1_crop_and_blur_only 61.1 (+- 0.3) 62.9
res50x1_crop_and_color_only 70.7 69.1
res50x1_crop_only 59.4 (+- 0.3) 55.3
res50x1_no_color 63.4 (+- 0.7) 63.8
res50x1_no_grayscale 70.3 70.5

Core symbols most depended-on inside this repo

_resnet
called by 10
resnet.py
pad_same
called by 6
resnet.py
update
called by 4
validate.py
_make_layer
called by 4
resnet.py
conv3x3
called by 3
resnet.py
conv1x1
called by 3
resnet.py
resnet50
called by 2
resnet.py
resnet200
called by 2
resnet.py

Shape

Function 19
Method 15
Class 5

Languages

Python100%

Modules by API surface

resnet.py26 symbols
validate.py12 symbols
convert.py1 symbols

For agents

$ claude mcp add byol-convert \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact