Implement class to crop pulsemaps to maximum length

Abierto
#648 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python, pytorch

Línea de trabajo

Read the pulsemap processing changes in #558 and find the existing NodeDefinition implementations. Then determine how node construction and cropping methods fit together, including whether the proposed reusable class supports the listed selection strategies. Done means pulsemaps can be cropped to a maximum length through a common class and the cropping methods can be reused by other node definitions.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

feature

Is your feature request related to a problem? Please describe.
With #558 we now have better control over how a pulsemap is processed. From the Kaggle competition it became apparent that many of the top scoring models simply cropped the number of pulses to some fixed number, to reduce the impact of the n^2 term from Self-Attention components.

While their primary way to select pulses was to simply select the first n pulses, I believe it might be interesting to look into other methods of selecting pulses. (Randomly, sorted by charge, sorted by probability of real signal, farthest point sampling etc.)

Describe the solution you'd like

To avoid having to implement many Node Definitions I think it might make sense to make a common class for all cropped nodes

class CroppedNodes(NodeDefinition):
    def __init__(self, max_pulses: int, cropping_method: Callable) -> None:
        super().__init__()
        self.max_pulses = max_pulses
        self._cropping_method = cropping_method

    def _construct_nodes(self, x: torch.Tensor) -> Data:
        x = self._cropping_method(x, self.max_pulses)
        return Data(x=x)

Such a structure would also allow to easier re-use the copping methods in other node definitions. (Maybe you want to crop after calculating summary nodes per dom, to make sure you do not get an event which triggered 5k doms.

Describe alternatives you've considered
We could of course just implement each cropping algorithm as a subclass of a common CroppedNodes class and have the logic restricted to each subclass. But I think the cropping logic is general enough that there is merit to have it as a separate component.

Lenguaje dominante
Python
Estrellas
117
Forks
115
Merge medio
2 d 21 h
PR fusionados (30 d)
1

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de graphnet-team/graphnet

Todos los issues de graphnet-team/graphnet

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.