Notebook source code:
notebooks/how_to/04_descriptor_pipeline.ipynb
Run it yourself on binder
How to create a descriptor pipeline?#
In [1]:
from geomfum.dataset import NotebooksDataset
from geomfum.descriptor.pipeline import (
ArangeSubsampler,
DescriptorPipeline,
L2InnerNormalizer,
)
from geomfum.descriptor.spectral import HeatKernelSignature, WaveKernelSignature
from geomfum.shape import TriangleMesh
In [2]:
dataset = NotebooksDataset()
mesh = TriangleMesh.from_file(dataset.get_filename("cat-00"))
INFO: Data has already been downloaded... using cached file ('/home/ubuntu/.geomfum/data/cat-00.off').
/home/ubuntu/giulio_vigano/geomfum_proj/venv/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebook_tqdm
In [3]:
mesh.laplacian.find_spectrum(spectrum_size=10, set_as_basis=True)
mesh.basis
Out [3]:
<geomfum.basis.LaplaceEigenBasis at 0x7764d94f4740>
A pipeline is composed of `Descriptor
<./03_descriptors.ipynb>`__, Subsampler
(./sampler.ipynb) and Normalizer
.
In [4]:
steps = [
HeatKernelSignature.from_registry(n_domain=4),
ArangeSubsampler(subsample_step=2),
WaveKernelSignature.from_registry(n_domain=3),
L2InnerNormalizer(),
]
pipeline = DescriptorPipeline(steps)
In [5]:
descr = pipeline.apply(mesh)
descr.shape
Out [5]:
(5, 7207)