facebookresearch / facebookresearch/SlowFast

Is the HOGLayerC in MaskFeat registered with "gkern"?

Open
#589 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.4k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

I found “hogs.0.gkern” in the pre-trained model weight (in1k_VIT_B_MaskFeat_PT_epoch_01600.pyth).

However, the definition of "self.hogs" in mask.py is

```
self.hogs.append(
operators.HOGLayerC(
nbins=self.nbins,
pool=self.cell_sz,
)
)
```

https://github.com/facebookresearch/SlowFast/blob/64f8d7e1f888c789f6e6ef881fc520cc88589cd0/slowfast/models/masked.py#L55

And, the initialization of HOGLayerC is

```
class HOGLayerC(nn.Module):
def __init__(self, nbins=9, pool=7, gaussian_window=0):
super(HOGLayerC, self).__init__()
self.nbins = nbins
self.pool = pool
self.pi = math.pi
weight_x = torch.FloatTensor([[1, 0, -1], [2, 0, -2], [1, 0, -1]])
weight_x = weight_x.view(1, 1, 3, 3).repeat(3, 1, 1, 1)
weight_y = weight_x.transpose(2, 3)
self.register_buffer("weight_x", weight_x)
self.register_buffer("weight_y", weight_y)

self.gaussian_window = gaussian_window
if gaussian_window:
gkern = get_gkern(gaussian_window, gaussian_window // 2)
self.register_buffer("gkern", gkern)
```

https://github.com/facebookresearch/SlowFast/blob/64f8d7e1f888c789f6e6ef881fc520cc88589cd0/slowfast/models/operators.py#L81

I don't think “self.register_buffer("gkern", gkern)” is being run.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.