Vectorisation like `np.vectorize` or `jax.vmap`
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
Piste de recherche
The issue mentions no files, tests, or entry points in the ndarray repository. Start by surveying the existing array and function APIs, then clarify the proposed vectorisation interface, supported argument patterns, parallelisation expectations, and tests needed to define when the feature is complete.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
This is a feature suggestion.
One of the important feature of numpy and jax in Python is to provide a vectorisation scheme for function.
Here is a mini example in Python:
import jax.numpy as np
# This function takes two float arguments and output a float
def func(x: float, y: float) -> float:
return x - y
# This vmap will give a vectorised func, now this vectorised_func
# can take an array as input and produce an array output.
# Here[0, None] means that we vectorise func's first argument only.
vectorised_func = jax.vmap(func, in_axes=[0, None])
# Test arrays
a = jnp.array([1., 2., 3])
b = 2.
vectorised_func(a, b) # This will output an array([-1, 0, 1])
# You can even do more to vectorise the y argument of func also
even_more_vectorised_func = jax.vmap(vectorised_func, in_axes=[None, 0])
#
c = jnp.array([3., 2., 1.])
even_more_vectorised_func(a, c) # This will output a matrix ([[-2, -1, 2], [-1, 0, 2], [0, 1, 2]])
In numpy, this is similar to np.vectorize, but np.vectorize is actually not using any parallelisation scheme unlike jax.vmap.
This feature, in my opinion, is very important for scientific computing. For example, if you have two arrays, you can use this to compute their pairwise distances. As an another example, in multidimensional numerical quadrature, computing \int f(x) dx requires to evaluting the function f by a number of node points, this could be significantly improved by vectorisation.
I am a researcher in signal processing and machine learning, and I can definetly say this feature is valuable.
- Langage dominant
- Rust
- Étoiles
- 4.3k
- Forks
- 391
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
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 rust-ndarray/ndarray
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
rust-ndarray/ndarray#1612 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
rust-ndarray/ndarray#1617 · 1 commentaire ·
-
Stack overflow in `triu` Ouvertebug good first issue
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
rust-ndarray/ndarray#1615 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
rust-ndarray/ndarray#1610 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 72/100
rust-ndarray/ndarray#1609 ·
Toutes les issues de rust-ndarray/ndarray
Issues similaires
-
risk:low runtime status:in-progress type:test
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
EricSpencer00/Resilient#4835 · 1 commentaire ·
-
agent:ready documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
cesarferreira/stax#890 ·
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100