Question regarding MOSAIKS Implementation
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 30/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- python, pytorch
- Domaine
- machine-learning
Piste de recherche
Commencez par la classe RCF présentée dans l’issue et examinez son implémentation dans pull request #70. Comparez le processus de convolution aléatoire du code avec la description de l’échantillonnage des patches dans l’article MOSAIK. La tâche est terminée lorsqu’il est déterminé si l’écart est intentionnel et que sa justification est documentée, ou lorsque la modification d’implémentation nécessaire est identifiée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Discrepancy between MOSAIK paper and MPC RCF implementation
Hi!
Given the recent open-sourcing of AlphaEarth by DeepMind and its comparison with MOSAIK [1], I was taking a closer look at the implementation from @calebrob6's PR (https://github.com/microsoft/PlanetaryComputerExamples/pull/70).
Expected behavior (from paper)
Based on the MOSAIK paper, the Random Convolution Features (RCF) process works as follows:
- Given an input image
I, features are computed by randomly samplingKpatches from acrossNimages from the training set - These
Kpatches are then convolved overIto obtainKfeature maps - The feature maps are averaged over pixels to produce a
K-dimensional feature vectorX_i
The following image from the paper illustrates this process:
Actual implementation
However, the MPC implementation uses a different approach:
class RCF(nn.Module):
"""A model for extracting Random Convolution Features (RCF) from input imagery."""
def __init__(self, num_features=16, kernel_size=3, num_input_channels=3):
super(RCF, self).__init__()
# We create `num_features / 2` filters so require `num_features` to be divisible by 2
assert num_features % 2 == 0
self.conv1 = nn.Conv2d(
num_input_channels,
num_features // 2,
kernel_size=kernel_size,
stride=1,
padding=0,
dilation=1,
bias=True,
)
nn.init.normal_(self.conv1.weight, mean=0.0, std=1.0)
nn.init.constant_(self.conv1.bias, -1.0)
def forward(self, x):
x1a = F.relu(self.conv1(x), inplace=True)
x1b = F.relu(-self.conv1(x), inplace=True)
x1a = F.adaptive_avg_pool2d(x1a, (1, 1)).squeeze()
x1b = F.adaptive_avg_pool2d(x1b, (1, 1)).squeeze()
if len(x1a.shape) == 1: # case where we passed a single input
return torch.cat((x1a, x1b), dim=0)
elif len(x1a.shape) == 2: # case where we passed a batch of > 1 inputs
return torch.cat((x1a, x1b), dim=1)
As I understand it, instead of using K kernels extracted from N training images (as described in the paper), this implementation creates K randomly initialized kernels. While randomly initialized kernels can be powerful feature extractors, this approach differs significantly from the paper's methodology.
Am I missing something that explains why this implementation choice was made? Is there a specific reason for deviating from the paper's approach of sampling patches from training images?
Thank you!
References
[1] Rolf, Esther, et al. "A generalizable and accessible approach to machine learning with global satellite imagery." Nature communications 12.1 (2021): 4392.
- Langage dominant
- Jupyter Notebook
- Étoiles
- 455
- Forks
- 225
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoft/PlanetaryComputerExamples
-
which version of IMERG? Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 68/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
-
Sentinel-5 P data usage Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
microsoft/PlanetaryComputerExamples#303 · 5 commentaires ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
Toutes les issues de microsoft/PlanetaryComputerExamples
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
bancolombia/sentinel#21 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
infer-actively/pymdp#454 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
huggingface/sentence-transformers#4055 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100