google-research / google-research/big_vision

Explanation of “resample_patchemb” function in flexiViT

Open
#142 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
3.5k
Forks
227
PR merge metrics
No merged PRs in 30d

Description

```
def resample_patchemb(old, new_hw):
"""Resample the weights of the patch embedding kernel to target resolution.

We resample the patch embedding kernel by approximately inverting the effect
of patch resizing. Colab with detailed explanation:
(internal link)
With this resizing, we can for example load a B/8 filter into a B/16 model
and, on 2x larger input image, the result will match.
See (internal link)
Args:
old: original parameter to be resized.
new_hw: target shape (height, width)-only.
Returns:
Resized patch embedding kernel.
"""
```
Can you provide a link to a Colab that explains this function?

Contributor guide

Open the contributing guide

Research direction

Start with the resample_patchemb function and the internal Colab and reference links in its docstring. Done means providing a public Colab that explains the resizing and why a B/8 filter can load into a B/16 model on a 2x larger input image.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter, python
Domain
documentation, machine-learning
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.