You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rq : une remarque d'ordre général. Je trouve ce que tu as codé et décrit dans la doc plus clair et intuitif que ce que je propose ci-dessous. Cependant, il me semble que ce qui est ci-dessous a plus de sens mathématiquement (transformée intégrale de la courbe d'Euler). Je pense donc que c'est la meilleure chose à implémenter mais je suis vraiment prêt à changer d'avis.
euler()
1. fonctionnement. Si on suit la définition suivante de transformée :
où fun est une primitive de k alors il faut pouvoir passer en argument deux réels M et fun_infty à la fonction euler() pour traiter le cas où k n'est pas intégrable sur [0,+\infty), i.e. quand fun n'est pas bien définie en +\infty. On pourrait imaginer un code qui renvoie:
et qui correspondrait au cas où fun(+\infty) =fun\_infty si M = None et sinon à prendre pour noyau *k * 1_{(-\infty, M]}, si M est un réel. Ainsi, la magnitude correspond à fun=lambda x:-math.exp(-x), et on peut la calculer avec euler(fun, M = None, fun_infty = 0).
2. output. Je ne sais pas ce qui est préférable pour la complexité mais il me semble pratique - et c'est du moins comme ça qu'on l'a codé - de pouvoir entrer un noyau fun et avoir comme sortie une fonctionT_{fun} : \R_{>0} -> \R plutôt qu'un nombre, que l'on peut du coup appeler sur un np.linspace(a,b,100), par exemple :
importnumpyasnpimportgudhiasgdfun=lambdax:np.cos(x)
ht_range=np.linspace(0, 1000, 100)
st=gd.AlphaComplex(X).create_simplex_tree()
ht=get_ht(st, fun) # this is a lambda functioneval_ht=ht(ht_range) # which can be evaluated on a np.array
il me semble que ça éviterait d'avoir à recalculer la transformée pour chaque valeur t (?). Je ne sais pas si c'est habituel cependant d'avoir une fonction lambda en output.
3. nom : on a pour habitude de l'appeler plutôt hybrid_transform() en référence aux transformées hybrides (arxiv Vad) parce que c'est la restriction à la (multi-)persistence de ces trucs-là. Cependant, dans le cas de la (multi-)persistance, transformées hybrides = transformées intégrales classiques (à une petite renormalisation près), c'est donc un peu superflu et peut-être égocentré, mais on a pas trouvé mieux. Peut-être persistent_transform() ?
4. description : (A terme, j'imagine qu'on pourra citer le papier avec Olympio.)
Computes an integral transform of the Euler curve, i.e. a function of the positive real variable that has an Euler characteristic's flavour.
Parameters:
fun (Callable[[float], float]) – kernel of the transform.
M (float, default=None) - upper bound for integration. Value None corresponds to integrating over all real numbers.
fun_infty (float, default = 0) - value of fun at +infinity (used only if M is None).
Returns: The function that associates to any positive real t, the sum over all simplices of (-1)**d * (fun(t*M) - fun(t* f)) where f is the filtration of the simplex and d its dimension. The Euler characteristic corresponds to the case fun = lambda _:-1, M = None, fun_infty = 0 while magnitude uses fun = lambda x:-math.exp(-x), M = None, fun_infty=0.
Return type:(Callable[[float], float])
euler_characteristic()
RAS
magnitude()
RAS. Seul le point 2. ci-dessus peut avoir également sa place ici s'il est validé pour euler().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Doc:
https://output.circle-artifacts.com/output/job/8b9aae69-0bb1-4946-b178-a2feeae60dd3/artifacts/0/doxygen/class_gudhi_1_1_simplex__tree.html
https://output.circle-artifacts.com/output/job/feacac1e-7215-4283-a1ab-ce05a25ec3ac/artifacts/0/sphinx/simplex_tree_ref.html