Show HN: Svetoviz – Visual debugger for large language models Svetoviz, a new Python package installable via `pip install svetoviz`, provides a visual debugger that streams tensors, images, NumPy arrays, Hugging Face datasets and PyTorch models to a custom WebGPU renderer running in a browser tab. The package includes a PyTorch debugger that traces the input-to-weights-to-output relation of every basic `torch.nn` module, and supports macOS (Apple Silicon) and Linux on x86_64/aarch64 with Python 3.9 through 3.14. Scenes are built from Views and Layouts and can be saved to disk as tiles plus a tree.db and converted with `sv.build_pmtiles_file()` for a remote URL, with the renderer running locally so no account or server-side compute is required. High-dimensional data visualization for NumPy, PyTorch, Hugging Face datasets and entire neural networks. Svetoviz is a debug viewer for tensors, images, NumPy arrays, datasets and PyTorch models. It ships as a single Python package svetoviz that streams your scene to a custom WebGPU renderer running in the browser, and includes a PyTorch debugger that traces the input - weights - output relation of every basic torch.nn module. Every section below mirrors the matching page of the documentation site https://www.svetoviz.com/docs https://www.svetoviz.com/docs one to one, in the same order. The section-to-page mapping, including the reference script, is listed in Documentation Index 13-documentation-index . Svetoviz is a high-dimensional data visualization engine. It ships with a custom WebGPU renderer that renders entire models and datasets in the browser, and a Python package svetoviz that lets you build your own visualizations with your own data. Your Python process builds a scene out of Views data sources and Layouts spatial containers and hands it to a renderer. Values are never flattened into a print statement or a single 2D image: every element gets a position in 3D space, and you navigate that space. - Model visualization: render entire models and datasets in the browser via the custom WebGPU renderer, or open the scene directly from the public spaces directory. - Dataset browser: visualize large datasets in the browser, or open the scene directly from the public spaces directory. - PyTorch Debugger: track the input - weights - output relations for every basic PyTorch module. - Your own data: build views from your own models, datasets and NumPy arrays with the Python package and open them in the browser - the renderer runs locally, no account needed. | Package | Renders in | macOS Apple Silicon | Linux | Python | |---|---|---|---|---| | svetoviz | A modern browser Chrome / Chromium WebGPU | Yes | Yes x86 64 / aarch64 | 3.9 - 3.14 | The single svetoviz package exposes one surface - sv.array , sv.tensor , sv.image , sv.view , sv.pytorch , sv.model , sv.pipeline , sv.save to disk , sv.load from disk - backed by one mapping implementation. It streams the scene to a browser tab and renders it client-side with a custom WebGPU pipeline: the renderer runs locally, so no account and no server-side compute are required. your python process renderer user --------------------- -------- ---- numpy / torch / PIL / HF dataset | +-- Views NumpyView, TensorView, DatasetView, ModelView, ... | +-- Layouts Vertical / Horizontal / Grid / Directory / Spiral | +-- sv.view scene ------------- WebGPU browser --------- 3D scene sv.save to disk scene -- tiles + tree.db -- sv.build pmtiles file -- remote URL This README mirrors the documentation site section by section. Every code block below is taken from the corresponding documentation page or from the reference script in this repository. . |-- README.md this document GitHub landing page |-- app.py local preview renderer for README.md not part of the package |-- examples/ | -- quickstart webgpu.py reference script for svetoviz -- assets/ -- images/ every screenshot embedded in this README Svetoviz is currently distributed via pip. Install the Svetoviz package WebGPU renderer with the following command: pip install svetoviz Or using a private repository: pip install svetoviz --extra-index-url https://svetoviz.com/webgpu/simple/ Compatibility: this package supports macOS Apple Silicon , Linux and Python versions 3.9 through 3.14 . Dependencies installed with the Svetoviz package: dependencies = "Flask =3.1,<4", "flask-cors =6.0,<7", "waitress =3.0,<4", "websockets =15,<16", "opencv-python =4.10", "psd-tools==1.11.0", "pmtiles==3.7.0", "petname==2.9", "requests =2.32,<3", "transformers =4.57,<6", "torch =2.8", "datasets =4.5,<6", Quick start: download examples/quickstart webgpu.py https://github.com/PiotrGryko/svetoviz/blob/main/examples/quickstart webgpu.py for the full reference script. The minimal starting point from that file: python examples/quickstart webgpu.py import os current dir = os.path.dirname os.path.abspath file cache dir = os.path.join current dir, "cache test" os.environ "SVETO VIZ CACHE DIR" = cache dir import svetoviz as sv import numpy as np print f"Cache dir: {sv.get cache dir }" data = np.random.rand 4, 4, 32, 32 .astype np.float32 sv.array data, gap size=10 opens http://localhost:8000 Cache data is written to SVETO VIZ CACHE DIR . Set the variable before importing svetoviz, otherwise cache data gets stored inside site packages: python import os current dir = os.path.dirname os.path.abspath file cache dir = os.path.join current dir, "cache test" os.environ "SVETO VIZ CACHE DIR" = cache dir import svetoviz as sv Verify the cache print f"Cache dir: {sv.get cache dir }" Run the demo to verify the installation: python import svetoviz as sv Run web demo sv.demo array Run web pytorch demo sv.demo modules sv.demo modules opens a collection of all supported PyTorch modules. Pass any string into the terminal view to process them, then use the timeline view to walk through the activations. Method definitions and parameter specifications for the svetoviz package. svetoviz | Signature | |---| | array cls, np array, gap size=0, ordering=None, host="localhost", http port=8000, ws port=8765, config=None | | arrays cls, arrays, gap size=0, host="localhost", http port=8000, ws port=8765, config=None | | tensor cls, tensor, gap size=0, ordering=None, host="localhost", http port=8000, ws port=8765, config=None | | tensors cls, tensors, gap size=0, host="localhost", http port=8000, ws port=8765, config=None | | image cls, image, host="localhost", http port=8000, ws port=8765, config=None | | images cls, images, host="localhost", http port=8000, ws port=8765, config=None | | pytorch cls, module, terminal callback=None, host="localhost", http port=8000, ws port=8765, blocking=True, config=None | | model cls, id, model, tokenizer=None, image processor=None, video processor=None, processor=None, scheduler=None, feature extractor=None, terminal callback=None, host="localhost", http port=8000, ws port=8765, blocking=True, config=None | | pipeline cls, id, pipe, terminal callback=None, host="localhost", http port=8000, ws port=8765, blocking=True, config=None | | view cls, view, terminal callback=None, host="localhost", http port=8000, ws port=8765, config=None | | save to disk cls, view, directory, threaded=True, max memory gb=2, image backend="pillow", compression="png 0" | | load from disk cls, directory, host="localhost", http port=8000, ws port=8765, config=None | | build pmtiles file cls, directory | | demo array cls, host="localhost", http port=8000 | | demo modules cls, host="localhost", http port=8000 | Parameter notes - gap size - integer spacing between visualized slices. Default 0 . - ordering - tuple or list defining the axis permutation, identical to numpy.transpose . The visualizer treats the last two dimensions as width and height, so arrays in H, W, C layout appear distorted and must be reordered, e.g. ordering= 2, 0, 1 . - image - accepts a URL string, a local file path, or a Pillow Image instance. Every web method accepts an optional config=WebConfig argument that controls the rendering of the scene: python class WebConfig: def init self, scene description description=None, Theme name, "Light" "Dark" "Darker" default theme="Dark", groups rendering mode, "lines", "none" groups mode="lines", matrix mode values up close , "quads", "cubes", "diamonds", "spheres" matrix mode="quads", stream values local only - stream values on mouse hover stream values=True, terminal and timeline - enable/disable terminal and timeline view terminal enabled=True, render labels - enable/disable TextViews. render labels=True : | Class | Signature | |---|---| | NumpyView | init self, id, data, gap size=1, ordering=None, description=None | | TensorView | init self, id, data, gap size=1, ordering=None, description=None | | LazyImageView | init self, id, image, description=None | | DiskImageView | init self, id, image, description=None | | DirectoryGridView | init self, id, directory, lazy=False, limit=None | | DirectorySpiralView | init self, id, directory, lazy=False, limit=None | | DatasetView | init self, id, dataset, image columns, info columns, cell width, cell height, image backend, info column mapping func | | ModelView | init self, id, model, tokenizer=None, image processor=None, video processor=None, processor=None, scheduler=None, feature extractor=None | | PipelineView | init self, id, pipe | | DiskSceneView | init self, id, directory | | Class | Signature | |---|---| | VerticalLayout | init self, id, views, title=None, title color=None, padding=None, spacing=None, gravity=None, background color=None | | HorizontalLayout | init self, id, views, title=None, title color=None, padding=None, spacing=None, gravity=None, background color=None | | GridLayout | init self, id, views, title=None, title color=None, padding=None, spacing=None, background color=None | | Class | Signature | |---|---| | RemotePmTilesView VerticalLayout | init self, id, pm tiles url, tree db file | | RemoteTilesView VerticalLayout | init self, id, depth, tile width, tile height, url pattern | | Call | Effect | |---|---| | get cache dir | Resolve the current cache directory | | save to disk view, directory, ... | Write a scene into tiles plus a tree.db | | load from disk directory | Open a built scene without the original data | | build pmtiles file directory | Turn a built scene into a PMTiles pyramid for remote hosting | Inside a terminal callback buffer, message, images, files : | Call | Effect | |---|---| | buffer.send user message text | Echo text as a user line in the terminal | | buffer.send system message text | Print a system line in the terminal | Svetoviz handles the full NumPy and PyTorch dtype spectrum: bool , int8 , int16 , int32 , int64 , uint8 , uint16 , uint32 , uint64 , float16 , bfloat16 , float32 , float64 , complex32 , complex64 , complex128 . Svetoviz provides native support for image data, abstracting away the boilerplate of loading and pre-processing. Whether dealing with local high-resolution TIFs, web-based JPGs, or in-memory PIL objects, the engine renders them directly into the 3D environment. The image method is polymorphic. It accepts local file paths, remote URLs, or existing Pillow PIL image objects. This is the fastest way to verify data integrity or inspect high-bit-depth scientific imagery. python import svetoviz as sv Supports URL, local path, or PIL object filepath = "/datasets/nasaimages/heic2409a.tif" sv.image filepath | Color map turbo | Zoom in to single pixel | |---|---| For multiple images, images allows you to pass a list of mixed-source images. The engine tiles them in 3D space, enabling you to rotate and zoom through entire batches. python import svetoviz as sv image1 url = "https://t4.ftcdn.net/jpg/02/70/3..." image2 url = "https://www.mamp.one/wp-content/..." image3 url = "https://img.freepik.com/free-photo/..." filepath1 = "random images/random image 1.jpg" filepath2 = "/datasets/nasaimages/heic1007a.tif" filepath3 = "/datasets/nasaimages/heic2409b.tif" filepath4 = "/datasets/nasaimages/heic2409a.tif" sv.images images= image1 url, image2 url, image3 url, filepath1, filepath2, filepath3, filepath4 Images processed via image and images are loaded eagerly and streamed directly from disk to ensure low latency during inspection. You can explicitly define the storage location for cached assets by modifying the global configuration: python Set an environment variable for caching import os os.environ "SVETO VIZ CACHE DIR" = "/path/to/your/custom/cache" import svetoviz as sv Verify cache directory current cache = sv.get cache dir While these methods are optimized for rapid previews and medium-sized batches, they are not intended for massive datasets. For high-performance scenes containing hundreds of thousands of images, use the Views API for tile-based, lazy-loading spatial optimization. The core of Svetoviz is its ability to handle raw NumPy arrays of any dimension and data type. Whether you are inspecting a single tensor or a collection of disparate arrays, the engine provides 3D spatial awareness for every element. Use array to project a single NumPy array into the 3D scene. The gap size parameter controls the visual spacing between high-dimensional slices, making it easier to identify patterns across tensors. python import svetoviz as sv data = np.random.rand 4, 4, 32, 32 .astype np.float32 sv.array data, gap size=10 Svetoviz handles high-dimensional tensors by "stacking" them along specific axes. This transforms multidimensional data into a physical 3D structure where numerical values are mapped to visual gradients in real time. | Dimensional stacking | Colormap application | |---|---| Svetoviz supports the full spectrum of NumPy dtypes - from standard integers and floats to complex numbers and booleans. Using arrays , you can pass a list of arrays with varying shapes and types. python import svetoviz as sv sv.arrays integers np.random.randint np.iinfo np.int8 .min, np.iinfo np.int8 .max, 2, 2, 128, 128 , dtype=np.int8 , np.random.randint np.iinfo np.int16 .min, np.iinfo np.int16 .max, 2, 3, 128, 128 , dtype=np.int16 , np.random.randint np.iinfo np.int32 .min, np.iinfo np.int32 .max, 4, 4, 64, 64 , dtype=np.int32 , np.random.randint np.iinfo np.int64 .min, np.iinfo np.int64 .max, 4, 2, 32, 64 , dtype=np.int64 , np.random.randint np.iinfo np.uint8 .min, np.iinfo np.uint8 .max, 2, 3, 128, 128 , dtype=np.uint8 , np.random.randint np.iinfo np.uint16 .min, np.iinfo np.uint16 .max, 16, 128, 128 , dtype=np.uint16 , np.random.randint np.iinfo np.uint32 .min, np.iinfo np.uint32 .max, 4, 4, 64, 64 , dtype=np.uint32 , np.random.randint np.iinfo np.uint64 .min, np.iinfo np.uint64 .max, 4, 2, 32, 64 , dtype=np.uint64 , np.random.randint np.iinfo np.ubyte .min, np.iinfo np.ubyte .max, 16, 16, 16 , dtype=np.ubyte , np.random.randint np.iinfo np.byte .min, np.iinfo np.byte .max, 8, 2, 24, 24 , dtype=np.byte , np.random.randint np.iinfo np.intp .min, np.iinfo np.intp .max, 64, 64 , dtype=np.intp , np.random.randint np.iinfo np.uintp .min, np.iinfo np.uintp .max, 64, 64 , dtype=np.uintp , np.random.choice True, False , 2, 72, 72 .astype np.bool , floats np.random.uniform -1, 1, 256, 256 np.finfo np.float16 .max .astype np.float16 , np.random.uniform -1, 1, 32, 32, 32 np.finfo np.float32 .max .astype np.float32 , np.random.uniform -1, 1, 4, 3, 32, 32 np.finfo np.float64 .max .astype np.float64 , complex numbers np.random.randn 32, 32 + 1j np.random.randn 32, 32 .astype np.complex64 , np.random.randn 32, 32 + 1j np.random.randn 32, 32 .astype np.complex128 , , gap size=32 By default, Svetoviz expects the last two dimensions of an array to represent the spatial height and width H, W . When passing standard image data in H, W, C format, the engine renders the channels as the spatial grid, resulting in a distorted view. python import svetoviz as sv Standard PIL to NumPy conversion results in H, W, C data = np.array image This will render incorrectly as it treats 'C' as part of the H, W pair sv.array data, gap size=0 To resolve this, use the ordering parameter to transpose the axes for the 3D projection without modifying the original array in memory. For a standard H, W, C image, use ordering= 2, 0, 1 to correctly map the dimensions. python import svetoviz as sv Standard PIL to NumPy conversion results in H, W, C data = np.array image Correctly map H, W, C to C, H, W for the 3D scene sv.array data, gap size=0, ordering= 2, 0, 1 Svetoviz handles large arrays with ease. You can, for example, see all frames from a videoclip at once, allowing for a comprehensive spatial overview of temporal data. python import svetoviz as sv Load your video as a numpy array array = video to 5d grid 'bunny.mp4' sv.array array Svetoviz provides integrated support for the Hugging Face datasets ecosystem. By utilizing the DatasetView , you can transform massive remote repositories into persistent, locally-browsable 3D environments with optimized image tiling. python import svetoviz as sv from datasets import load dataset hf name = "Dewa/Dog Emotion Dataset v2" dataset = load dataset hf name, split="train" layout = sv.DatasetView id=hf name, dataset=dataset, image columns= "image" , info columns= "emotion" , cell width=400, cell height=400 sv.save to disk view=layout, compression="png 0", directory=output directory DatasetView parameters: | Parameter | Meaning | |---|---| | id | Scene / dataset identifier shown in the viewer | | dataset | A datasets.Dataset or a select subset of it | | image columns | Columns holding images to tile into the grid | | info columns | Text columns indexed into the search database | | cell width / cell height | Pixel size of each rendered entry | | image backend | Pillow or the alternative image backend | | info column mapping func | Maps raw ids to human labels | python import svetoviz as sv sv.load from disk directory=output directory Include info columns to automatically build the search database: python import svetoviz as sv from datasets import load dataset hf name = "eltorio/ROCOv2-radiology" dataset = load dataset hf name, split="train" layout = sv.DatasetView id=hf name, dataset=dataset, image columns= "image" , info columns= "image id", "caption", "cui" , cell width=400, cell height=400 sv.save to disk view=layout, compression="png 0", directory=output directory sv.load from disk directory=output directory Use the web interface to search over the entire dataset: You can also explore datasets already published online at https://app.svetoviz.com https://app.svetoviz.com . The selected compression type dictates the following parameters of the final scene: - Quality of the final scene - Total disk usage of the final scene - Total build time of the scene PNG compression levels | Available constants | |---| | PNG 0 Highest Quality | | PNG 1 | | PNG 2 | | PNG 3 | | PNG 4 | | PNG 5 | | PNG 6 | | PNG 7 | | PNG 8 | | PNG 9 Lowest Quality | JPEG compression levels | Available constants | |---| | JPEG 0 Highest Quality | | JPEG 1 | | JPEG 2 | | JPEG 3 | | JPEG 4 | | JPEG 5 | | JPEG 6 | | JPEG 7 | | JPEG 8 | | JPEG 9 Lowest Quality | The Views API provides a declarative way to organize multiple data sources into a single 3D scene. By using Layout containers, you can create structured environments for comparative analysis and large-scale dataset inspection. The Views API is built on two primary class types: View and Layout . - Views represent individual data points, encapsulating various formats such as NumPy arrays, images, or other specialized data structures. - Layouts organize collections of views into structured 3D scenes by defining spatial relationships, such as line arrangements or grids. Layouts are inherently composable, allowing you to nest them within one another to build complex, multi-tiered visual environments. python import svetoviz as sv view = sv.NumpyView id="numpy view example", data=np.random.rand 4, 4, 32, 32 .astype np.float32 , gap size=10 sv.view view=view python import svetoviz as sv image = Image.open BytesIO requests.get IMAGE URL .content data = np.array image view = sv.NumpyView id="numpy image channels", data=data, gap size=10, ordering= 2, 0, 1 sv.view view=view | Raw array projection | Transposed mapping | |---|---| For images, use DiskImageView to stream assets directly from storage, or LazyImageView to lazy-load images into RAM only when required. Both classes accept a URL, a local file path, or a PIL image object as the source. python import svetoviz as sv view = sv.DiskImageView id="disc image", image=IMAGE URL or view = sv.LazyImageView id="lazy image", image=IMAGE URL sv.view view=view The DirectoryGridView is a specialized layout class designed to automatically load and organize an entire directory of images into a structured grid scene. python import svetoviz as sv Optional function to provide searchable description per filepath def description func filepath : return f"My description for {filepath}" layout = sv.DirectoryGridView id="directory grid example", directory=directory, limit=100, lazy=False, description func=description func sv.view layout | Grid overview | Grid spread | |---|---| The DirectorySpiralView is a specialized layout class designed to automatically load and organize an entire directory of images into a structured spiral scene. python import svetoviz as sv Optional function to provide searchable description per filepath def description func filepath : return f"My description for {filepath}" layout = sv.DirectorySpiralView id="directory spiral view", directory=directory, limit=100, lazy=False, description func=description func sv.view layout | Spiral overview | Spiral spread | |---|---| Lazy vs eager loading - lazy=True is limited by available RAM, and the scene may appear empty at launch until data loads. - lazy=False is limited by available disc space for the DiskImageView memory files and by the maximum number of open file descriptors. - sv.view may start failing around 500 - 1000 data points. For larger collections, build the scene offline see Offline scene building offline-scene-building . The DatasetView enables the integration of Hugging Face datasets directly into your scene. It automatically processes a dataset object and renders its entries into a structured grid of images. You will learn more about DatasetView in Datasets 6-datasets . python import svetoviz as sv hf name = "Dewa/Dog Emotion Dataset v2" dataset = load dataset hf name, split="train" subset = dataset.select range 100 layout = sv.DatasetView id=hf name, dataset=subset, info columns= "emotion" , image columns= "image" , cell width=400, cell height=400 sv.view layout The VerticalLayout arranges its child views in a linear vertical stack. python import svetoviz as sv numpy array = np.random.rand 4, 4, 32, 32 .astype np.float32 image = Image.open BytesIO requests.get IMAGE URL .content image array = np.array image layout = sv.VerticalLayout id="vertical layout example", views= sv.NumpyView id="array", data=numpy array, gap size=10, ordering=None , sv.NumpyView id="image array", data=image array, gap size=10, ordering= 2, 0, 1 , sv.DiskImageView id="disc image", image=image , sv.LazyImageView id="lazy image", image=image , sv.view layout The HorizontalLayout arranges its child views in a linear horizontal stack. python import svetoviz as sv numpy array = np.random.rand 4, 4, 32, 32 .astype np.float32 image = Image.open BytesIO requests.get IMAGE URL .content image array = np.array image layout = sv.HorizontalLayout id="layout", title="Horizontal layout", views= sv.NumpyView id="array", data=numpy array, gap size=10 , sv.NumpyView id="image array", data=image array, gap size=10, ordering= 2, 0, 1 , sv.DiskImageView id="disc image", image=image , sv.LazyImageView id="lazy image", image=image , sv.view layout The GridLayout arranges its child views in a grid. python import svetoviz as sv directory = "downloaded images" image sources = for root, dirs, files in os.walk directory : for file in files: image sources.append os.path.join root, file image views = sv.DiskImageView id=f"img {i}", image=src or sv.LazyImageView id=f"img {i}", image=src for i, src in enumerate image sources grid = sv.GridLayout id="grid layout example", views=image views sv.view grid Layouts can be nested to create complex, multi-tiered scenes. Each layout object accepts an optional title argument; when provided, the title is rendered as an additional child at the beginning of the collection, adhering to the parent's defined spatial positioning. python import svetoviz as sv disc image = sv.DiskImageView id="disc image", image="sample image.jpg" lazy image = sv.LazyImageView id="lazy image", image="sample image.jpg" array = sv.NumpyView id="array", data=np.random.rand 4, 32, 4, 245, 245 .astype np.float32 , gap size=10 images directory = "downloaded images" dir spiral view = sv.DirectorySpiralView id="dir spiral", directory=images directory, limit=100, lazy=False dir grid view = sv.DirectoryGridView id="dir grid", directory=images directory, limit=100, lazy=False hf name = "Dewa/Dog Emotion Dataset v2" dataset = load dataset hf name, split="train" subset = dataset.select range 500 subset2 = dataset.select range 500, 1000 subset view 1 = sv.DatasetView id="subset1", dataset=subset, image columns= "image" , info columns= "emotion" , cell width=400, cell height=400 subset view 2 = sv.DatasetView id="subset2", dataset=subset2, image columns= "image" , info columns= "emotion" , cell width=400, cell height=400 array container = sv.VerticalLayout id="Numpy", title="Numpy", views= array image container = sv.VerticalLayout id="Image", title="Images", views= disc image, lazy image directory grid container = sv.VerticalLayout id="directory grid id", title="Directory grid view", views= dir grid view directory spiral container = sv.VerticalLayout id="directory spiral id", title="Directory spiral view", views= dir spiral view subset 1 container = sv.VerticalLayout id="dataset subset 1", title="Subset 1", views= subset view 1 subset 2 container = sv.VerticalLayout id="dataset subset 2", title="Subset 2", views= subset view 2 layout = sv.GridLayout id="parent layout", views= image container, array container, directory grid container, directory spiral container, subset 1 container, subset 2 container sv.view layout You can switch between different layout types at any time directly through the web interface. Additionally, you can dynamically modify properties such as spacing, padding, and spread to refine the spatial organization of your scene. | Horizontal spread | Vertical spread | |---|---| Displaying a scene with view is typically sufficient for scenes containing a small number of data points. For large-scale scenes, build your scene offline. Once the scene is built, you can launch it directly from the directory without requiring access to the original source data. This example demonstrates building a unified scene from the complete ESA/Hubble and ESA/Webb image catalogs in maximum quality. python import svetoviz as sv images directory = "/Users/piotrgryko/Desktop/nasaimages" config file path = os.path.join images directory, "config.json" scraped data = {} with open config file path, "r", encoding="utf-8" as f: scraped data = json.load f def description func filepath : filename = os.path.basename filepath name without ext = os.path.splitext filename 0 metadata = scraped data.get name without ext, {} lines = for key, value in metadata.items : lines.append f"{key}: {value}" return "\n\n".join lines layout = sv.DirectorySpiralView id="Galaxy", directory=images directory, lazy=True, description func=description func Export to persistent storage sv.save to disk view=layout, threaded=True, directory="output/space scene", compression="jpeg 0" Once the build is complete, launch the interactive 3D environment directly from the directory: python import svetoviz as sv sv.load from disk directory="output/space scene" Alternatively, you can process the scene further and generate a PMTiles file for remote hosting and streaming: python import svetoviz as sv Create PMTiles file inside the scene directory sv.build pmtiles file directory="output/space scene" After uploading the generated PMTiles file to a remote server, you can browse the scene from anywhere without distributing the original dataset: python import svetoviz as sv db file = "output/space scene/tree.db" url = "your remote pmtiles file url" layout = sv.RemotePmTilesLayout id="universe", pm tiles url=url, tree db file=db file sv.view layout To re-open a saved scene as a widget instead of launching it, use DiskSceneView : python import svetoviz as sv Saved Dog Emotion Dataset v2 dataset view = sv.DiskSceneView id="dog emotions", directory="output/dog emotion dataset" Saved ROCOv2-radiology dataset view2 = sv.DiskSceneView id="roco radiology", directory="output/roco scene" layout = sv.VerticalLayout id="scenes", views= view, view2 sv.view layout Svetoviz supports torch.Tensor visualization exactly like standard NumPy arrays. Use tensor to project a single torch.Tensor into the 3D scene. The gap size parameter controls the visual spacing between high-dimensional slices. python import svetoviz as sv data = torch.rand 4, 4, 256, 256 , dtype=torch.float32 sv.tensor data, gap size=10 Svetoviz supports the full spectrum of torch dtypes - from standard integers and floats to complex numbers and booleans. Using tensors , you can pass a list of torch.Tensor with varying shapes and types. python import svetoviz as sv sv.tensors integers torch.randint 0, 2, 2, 72, 72 , dtype=torch.bool , torch.randint np.iinfo np.int8 .min, np.iinfo np.int8 .max, 2, 60, 60 , dtype=torch.int8 , torch.randint np.iinfo np.int16 .min, np.iinfo np.int16 .max, 4, 8, 16, 16 , dtype=torch.int16 , torch.randint np.iinfo np.int32 .min, np.iinfo np.int32 .max, 4, 4, 64, 64 , dtype=torch.int32 , torch.randint np.iinfo np.int64 .min, np.iinfo np.int64 .max, 4, 2, 32, 64 , dtype=torch.int64 , torch.randint np.iinfo np.uint8 .min, np.iinfo np.uint8 .max, 2, 3, 128, 128 , dtype=torch.uint8 , torch.randint np.iinfo np.uint16 .min, np.iinfo np.uint16 .max, 16, 128, 128 , dtype=torch.uint16 , torch.randint np.iinfo np.uint32 .min, np.iinfo np.uint32 .max, 4, 4, 64, 64 , dtype=torch.uint32 , torch.frombuffer np.random.bytes 4 2 32 64 8 , dtype=torch.uint64 .reshape 4, 2, 32, 64 , floats torch.rand 256, 256, dtype=torch.float32 torch.finfo torch.float16 .max .to torch.float16 , torch.rand 256, 256, dtype=torch.float32 torch.finfo torch.bfloat16 .max .to torch.bfloat16 , torch.rand 256, 256, dtype=torch.float32 torch.finfo torch.float32 .max .to torch.float32 , torch.rand 256, 256, dtype=torch.float64 torch.finfo torch.float64 .max .to torch.float64 , complex numbers torch.complex torch.rand 32, 32 , torch.rand 32, 32 .to torch.complex32 torch.finfo torch.complex32 .max, torch.complex torch.rand 32, 32 , torch.rand 32, 32 .to torch.complex64 torch.finfo torch.complex64 .max, torch.complex torch.rand 32, 32 , torch.rand 32, 32 .to torch.complex128 torch.finfo torch.complex128 .max , gap size=32 torch.Tensor visualization inherits all features from standard NumPy views, including stacking, ordering, colormaps, and large tensor support. TensorView is also the primary view used for rendering PyTorch models. python import svetoviz as sv view = sv.TensorView id="tensor view example", data=torch.rand 4, 4, 256, 256 , dtype=torch.float32 , gap size=10 sv.view view=view Svetoviz provides two primary methods for attaching the debugger to your models. python @classmethod def model cls, id, model, tokenizer=None, image processor=None, video processor=None, processor=None, scheduler=None, feature extractor=None, terminal callback=None, blocking=True python @classmethod def pipeline cls, id, pipe, terminal callback=None, blocking=True To interact with the model, use the terminal callback function to send data directly from the GUI, or use the blocking=False argument WebGPU only to attach the debugger in non-blocking mode and continue your standard interaction loop. Selected breakpoints flash during interaction, and their activations are automatically collected. Afterward, you can visually inspect the input and output data alongside their relation to the module. python import svetoviz as sv tokenizer = GPT2Tokenizer.from pretrained 'gpt2', device map="cpu" model = GPT2LMHeadModel.from pretrained 'gpt2', device map="cpu" def terminal callback buffer, message, images, files : message, images and files come from GUI terminal input inputs = tokenizer message, return tensors="pt" Generate continuation outputs = model.generate inputs, max new tokens=50 Decode to string decoded = tokenizer.decode outputs 0 , skip special tokens=True Send messages back to GUI buffer.send user message message buffer.send system message decoded sv.model id="GPT2", model=model, tokenizer=tokenizer, terminal callback=terminal callback | GPT-2 architecture | GPT tokenizer | |---|---| python import svetoviz as sv image processor = DetrImageProcessor.from pretrained "facebook/detr-resnet-50", revision="no timm", device map="cpu" model = DetrForObjectDetection.from pretrained "facebook/detr-resnet-50", revision="no timm", device map="cpu" def terminal callback buffer, message, images, files : images is an PIL.Image array of images added to terminal GUI for image in images: inputs = image processor images=image, return tensors="pt" outputs = model inputs buffer.send system message "processed" sv.model id="DERT", model=model, image processor=image processor, terminal callback=terminal callback | DETR Conv2d | DETR kernel | |---|---| | YOLOS Conv2d | YOLOS linear | |---|---| The blocking=False argument starts the debugger in non-blocking mode, allowing you to continue with your model interaction as usual. python import svetoviz as sv tokenizer = AutoTokenizer.from pretrained "speakleash/Bielik-Minitron-7B-v3.0-Instruct" model = AutoModelForCausalLM.from pretrained "speakleash/Bielik-Minitron-7B-v3.0-Instruct", torch dtype=torch.float16 sv.model id="Bielik-Minitron-7B", model=model, tokenizer=tokenizer, blocking=False while True: Debugger is attached. You can interact or inspect training loop text = my external input message inputs = tokenizer text, return tensors="pt" outputs = model.generate inputs, max new tokens=50 Collected activations are stored in RAM. For small models, you can inspect an entire pass. For larger models like diffusion models, select specific breakpoints. For example, you can select the Scheduler module to see each step of the denoising process. python import svetoviz as sv pipe = DiffusionPipeline.from pretrained "stable-diffusion-v1-5/stable-diffusion-v1-5", torch dtype=torch.float16 pipe = pipe.to "mps" pipe.enable attention slicing def terminal callback buffer, message, images, files : Generate an image from terminal input message buffer.send system message message image = pipe message .images 0 image.show "output.png" sv.pipeline id="stable-diffusion-v1-5", pipe=pipe, terminal callback=terminal callback | stable-diffusion-1-5 structure | stable-diffusion-1-5 activation | |---|---| Use the Views API with ModelView or PipelineView to build a compressed, static representation of the model: python import svetoviz as sv view = sv.ModelView id="detr-resnet-50", model=model, image processor=image processor sv.save to disk view=view, directory="output/detr scene" Use the settings window to modify various rendering aspects of your scene. Adjust themes, layouts, or matrix settings to control the visual representation of data values when viewed at close range WebConfig.matrix mode : quads , cubes , diamonds , spheres . Online models are browsable at https://www.svetoviz.com https://www.svetoviz.com . The svetoviz Python package is the entry point for the whole application. Every helper builds a scene in your Python process and streams it to the WebGPU renderer, which opens automatically in your browser at http://localhost:8000 . There is no separate native binary to install - the renderer ships with the package and runs locally. Download examples/quickstart webgpu.py https://github.com/PiotrGryko/svetoviz/blob/main/examples/quickstart webgpu.py for a complete, runnable script. Every data type is reached through the same set of class methods, so moving between arrays, images, tensors and models only changes the function you call: | Call | Purpose | |---|---| | sv.array np array, gap size=0, ordering=None | Visualize a single NumPy array | | sv.arrays arrays, gap size=0 | Visualize a list of NumPy arrays | | sv.tensor tensor, gap size=0, ordering=None | Visualize a single torch.Tensor | | sv.tensors tensors, gap size=0 | Visualize a list of tensors | | sv.image image | Visualize one image URL / path / PIL | | sv.images images | Visualize a list of images | | sv.pytorch module, terminal callback=None | Attach the debugger to a nn.Module | | sv.model id, model, ... | Attach the debugger to a Hugging Face model | | sv.pipeline id, pipe, ... | Attach the debugger to a pipeline | | sv.view view | Open a View or Layout instance | | sv.save to disk view, directory, ... | Build a scene offline | | sv.load from disk directory | Open a previously built scene | Assemble a scene from Views and Layouts and control the spatial organization with padding , spacing and gravity . These arguments are available on every layout container, so the same code produces a consistent scene whether it is opened live or built offline. python import svetoviz as sv import numpy as np view = sv.GridLayout id="layout", title="Grid Layout", padding="2%", title color= 155, 155, 155 , background color= 0, 0, 0, 255 , spacing=40, views= sv.VerticalLayout id="vertical1", title="np.float32", padding="5%", spacing="5%", background color= 50, 50, 50, 255 , views= sv.NumpyView id="float32", data=np.random.rand 6, 24, 128, 32 .astype np.float32 , gap size=10, ordering=None , sv.VerticalLayout id="vertical2", title="Images", padding="5%", spacing="5%", background color= 50, 50, 50, 255 , views= sv.DiskImageView id="disk image", image=IMAGE URL , sv.LazyImageView id="lazy image", image=IMAGE URL , , sv.view view=view Directory views load and organize an entire folder of images into a structured scene: python import svetoviz as sv view = sv.DirectorySpiralView directory="downloaded images", limit=200, lazy=False sv.view view Build a scene once and reopen it later without the original data. save to disk writes tiles plus a tree.db , and load from disk opens it again: python import svetoviz as sv sv.save to disk view=view, directory="output/scene" sv.load from disk directory="output/scene" Svetoviz provides native support for PyTorch modules. Your interaction activations are collected and presented on the screen, allowing for real-time inspection of data transformations. 114 documented modules are supported: 73 module pages plus 28 activation functions and 13 loss functions. Every module is traced through the same pipeline: input - weights - output, with the exact relation between a selected output value and the input values that produced it. The three views below show that pipeline on nn.Conv3d . First the input volume is convolved by the learned kernel, producing a stack of spatial feature maps. Then each output value can be traced back to the exact input positions and kernel weights that produced it. Finally, the weights, bias, input and output tensors are inspected side by side for the selected value. nn.Conv3d feature maps - the input volume convolved with the learned kernel produces one spatial feature map per output channel. nn.Conv3d value mapping - a selected output value is traced back to the input patch and the kernel weights that produced it. nn.Conv3d bias and weight inspection - weights, bias, input and output tensors are shown side by side for the selected value. The pytorch interface wraps your nn.Module and provides a terminal for live interaction. This allows you to process data and inspect the resulting tensors without leaving the visualization environment. python import svetoviz as sv import torch import torch.nn as nn from PIL import Image Prepare data url = "https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" img = Image.open requests.get url, stream=True .raw .resize 64, 64 img np = np.array img .transpose 2, 0, 1 image data = torch.from numpy img np .float .unsqueeze 0 Your pytorch module conv = nn.Conv2d 3, 4, 5, padding=10 def terminal callback buffer, message, images, files : Interact with the module as you normally do conv image data buffer.send system message "processed" Start the session sv.pytorch module=conv, terminal callback=terminal callback You can hover or click on output values to see the mappings and relations between layers. Svetoviz provides a visual explanation of the provenance for each value in the tensor. For example, you can find the exact kernel position for convolutions, or visualize the column-to-patch mapping for operations like fold and unfold . Clicking an output value reveals the input-to-output spatial relationship. Each table lists the module, a one-line purpose and the parameters that matter most when inspecting it. The tables follow the documentation category order: convolution, pooling, padding, normalization, linear and embedding, dropout, shape and view, then activation functions, and loss functions last. Every module links to its illustrated guide on https://pytorch.svetoviz.com https://pytorch.svetoviz.com . | Module | Purpose | Key parameters | |---|---|---| | nn.Conv1d | 1-D convolution over signals N, C, L | in channels , out channels , kernel size , stride , padding , dilation , groups | | nn.ConvTranspose1d | Transposed 1-D convolution learned upsampling | in channels , out channels , kernel size , stride , padding , output padding | | nn.Conv2d | 2-D convolution over images N, C, H, W | in channels , out channels , kernel size , stride , padding , groups | | nn.ConvTranspose2d | Transposed 2-D convolution decoders, GANs | in channels , out channels , kernel size , stride , padding , output padding | | nn.Conv3d | 3-D convolution over volumes N, C, D, H, W | in channels , out channels , kernel size , stride , padding | | nn.ConvTranspose3d | Transposed 3-D convolution | in channels , out channels , kernel size , stride , padding | | Module | Purpose | Key parameters | |---|---|---| | nn.MaxPool1d | Max pooling over 1-D signals | kernel size , stride , padding , dilation , return indices | | nn.MaxPool2d | Max pooling over 2-D feature maps | kernel size , stride , padding , return indices | | nn.MaxPool3d | Max pooling over 3-D volumes | kernel size , stride , padding , return indices | | nn.MaxUnpool1d | Inverse of MaxPool1d using stored indices | kernel size , stride , padding | | nn.MaxUnpool2d | Inverse of MaxPool2d using stored indices | kernel size , stride , padding | | nn.MaxUnpool3d | Inverse of MaxPool3d using stored indices | kernel size , stride , padding | | nn.AvgPool1d | Average pooling over 1-D signals | kernel size , stride , padding , count include pad | | nn.AvgPool2d | Average pooling over 2-D feature maps | kernel size , stride , padding , count include pad | | nn.AvgPool3d | Average pooling over 3-D volumes | kernel size , stride , padding , count include pad | | nn.LPPool1d | Lp-norm pooling over 1-D signals | norm type , kernel size , stride | | nn.LPPool2d | Lp-norm pooling over 2-D feature maps | norm type , kernel size , stride | | nn.LPPool3d | Lp-norm pooling over 3-D volumes | norm type , kernel size , stride | | nn.AdaptiveMaxPool1d | Max pool to a fixed output length | output size , return indices | | nn.AdaptiveMaxPool2d | Max pool to a fixed output grid | output size , return indices | | nn.AdaptiveMaxPool3d | Max pool to a fixed output volume | output size , return indices | | nn.AdaptiveAvgPool1d | Average pool to a fixed output length | output size | | nn.AdaptiveAvgPool2d | Average pool to a fixed output grid | output size | | nn.AdaptiveAvgPool3d | Average pool to a fixed output volume | output size | | nn.FractionalMaxPool2d | Random-step max pooling with fractional coverage | kernel size , output ratio / output size | | nn.FractionalMaxPool3d | 3-D fractional max pooling | kernel size , output ratio / output size | | Module | Purpose | Key parameters | |---|---|---| | nn.ReflectionPad1d | Reflects the signal at the border 1-D | padding | | nn.ReflectionPad2d | Reflects the image at the border 2-D | padding | | nn.ReflectionPad3d | Reflects the volume at the border 3-D | padding | | nn.ReplicationPad1d | Repeats edge values 1-D | padding | | nn.ReplicationPad2d | Repeats edge values 2-D | padding | | nn.ReplicationPad3d | Repeats edge values 3-D | padding | | nn.ZeroPad1d | Zero padding 1-D | padding | | nn.ZeroPad2d | Zero padding 2-D | padding | | nn.ZeroPad3d | Zero padding 3-D | padding | | nn.ConstantPad1d | Constant-value padding 1-D | padding , value | | nn.ConstantPad2d | Constant-value padding 2-D | padding , value | | nn.ConstantPad3d | Constant-value padding 3-D | padding , value | | nn.CircularPad1d | Wraps the signal around 1-D | padding | | nn.CircularPad2d | Wraps the image around 2-D | padding | | nn.CircularPad3d | Wraps the volume around 3-D | padding | | Module | Purpose | Key parameters | |---|---|---| | nn.BatchNorm1d | Normalizes per channel across a batch 1-D | num features , eps , momentum , affine , track running stats | | nn.BatchNorm2d | Normalizes per channel across a batch 2-D | num features , eps , momentum , affine | | nn.BatchNorm3d | Normalizes per channel across a batch 3-D | num features , eps , momentum , affine | | nn.InstanceNorm1d | Normalizes each sample independently 1-D | num features , eps , momentum , affine , track running stats | | nn.InstanceNorm2d | Normalizes each sample independently 2-D | num features , eps , momentum , affine | | nn.InstanceNorm3d | Normalizes each sample independently 3-D | num features , eps , momentum , affine | | nn.LayerNorm | Normalizes over the trailing normalized shape | normalized shape , eps , elementwise affine | | nn.GroupNorm | Splits channels into groups and normalizes each | num groups , num channels , eps , affine | | nn.LocalResponseNorm | Lateral inhibition across neighbouring channels | size , alpha , beta , k | | Module | Purpose | Key parameters | |---|---|---| | nn.Linear | Fully connected transform y = xA^T + b | in features , out features , bias | | nn.Bilinear | Bilinear combination of two inputs | in1 features , in2 features , out features , bias | | nn.Embedding | Lookup table mapping indices to vectors | num embeddings , embedding dim , padding idx , max norm | | nn.EmbeddingBag | Embedding lookup with on-the-fly reduction | num embeddings , embedding dim , mode mean / sum / max | | nn.CosineSimilarity | Cosine similarity along a dimension | dim , eps | | nn.PairwiseDistance | p-norm distance between two batches | p , eps , keepdim | | Module | Purpose | Key parameters | |---|---|---| | nn.Dropout | Randomly zeroes elements during training | p , inplace | | nn.Dropout1d | Drops entire 1-D channels | p , inplace | | nn.Dropout2d | Drops entire feature maps | p , inplace | | nn.Dropout3d | Drops entire volumetric channels | p , inplace | | nn.AlphaDropout | Self-normalizing dropout for SELU networks | p , inplace | | nn.FeatureAlphaDropout | Channel-wise AlphaDropout | p , inplace | | Module | Purpose | Key parameters | |---|---|---| | nn.Unfold | Extracts sliding local blocks into columns | kernel size , dilation , padding , stride | | nn.Fold | Combines sliding local blocks back into a tensor | output size , kernel size , dilation , padding , stride | | nn.Flatten | Flattens a contiguous range of dimensions | start dim , end dim | | nn.Unflatten | Expands one dimension into a shape | dim , unflattened size | | nn.PixelShuffle | Rearranges , C r^2, H, W into , C, H r, W r | upscale factor | | nn.PixelUnshuffle | Inverse rearrangement of PixelShuffle | downscale factor | | nn.Upsample | Generic resampling of spatial dimensions | size / scale factor , mode , align corners | | nn.UpsamplingNearest2d | Nearest-neighbour upsampling, deprecated alias | size / scale factor | | nn.UpsamplingBilinear2d | Bilinear upsampling, deprecated alias | size / scale factor | | nn.ChannelShuffle | Interleaves channels between groups | groups | | nn.Identity | Pass-through, useful as a breakpoint placeholder | none | python import svetoviz as sv def demo activation : input tensor = torch.from numpy img np \ .view 1, 1, height, width \ .repeat 1, 2, 1, 1 activations = nn.ModuleDict { "ReLU": nn.ReLU , "LeakyReLU": nn.LeakyReLU negative slope=0.02 , "PReLU": nn.PReLU num parameters=2 , "GELU": nn.GELU , "SiLU": nn.SiLU , "Mish": nn.Mish , "Hardswish": nn.Hardswish , "Sigmoid": nn.Sigmoid , "Tanh": nn.Tanh , "Softmax": nn.Softmax dim=1 , "LogSoftmax": nn.LogSoftmax dim=-1 , "ELU": nn.ELU , "SELU": nn.SELU , "Softplus": nn.Softplus , "Threshold": nn.Threshold threshold=0.1, value=-2.0 , "Softshrink": nn.Softshrink lambd=0.5 , "GLU": nn.GLU dim=1 , "Hardshrink": nn.Hardshrink lambd=0.5 , "Hardsigmoid": nn.Hardsigmoid , "Hardtanh": nn.Hardtanh min val=-1.0, max val=1.0 , "LogSigmoid": nn.LogSigmoid , "ReLU6": nn.ReLU6 , "RReLU": nn.RReLU , "CELU": nn.CELU , "Softsign": nn.Softsign , "Tanhshrink": nn.Tanhshrink , "Softmin": nn.Softmin dim=1 , "Softmax2d": nn.Softmax2d } def terminal callback buffer, message, images, files : for name, module in activations.items : output = module input tensor buffer.send system message f"Applied {name}: Output shape {list output.shape }" sv.pytorch module=activations, terminal callback=terminal callback | Module | Purpose | Key parameters | |---|---|---| | nn.ReLU | Half-wave rectifier, max 0, x | inplace | | nn.LeakyReLU | ReLU with a small negative slope | negative slope , inplace | | nn.PReLU | ReLU with a learned negative slope | num parameters , init | | nn.GELU | Gaussian error linear unit | approximate none / tanh | | nn.SiLU | Sigmoid-weighted linear unit Swish | inplace | | nn.Mish | Smooth non-monotonic activation | inplace | | nn.Hardswish | Piecewise-linear approximation of SiLU | inplace | | nn.Sigmoid | Logistic squashing to 0, 1 | none | | nn.Tanh | Hyperbolic tangent, zero-centred | none | | nn.Softmax | Normalizes values into a probability simplex | dim | | nn.LogSoftmax | Log of the softmax, numerically stable | dim | | nn.Softmin | Softmax over negated inputs | dim | | nn.Softmax2d | Softmax over each spatial location | none | | nn.ELU | Exponential linear unit | alpha , inplace | | nn.SELU | Self-normalizing exponential unit | inplace | | nn.CELU | Continuously differentiable exponential unit | alpha , inplace | | nn.Softplus | Smooth approximation of ReLU | beta , threshold | | nn.Softsign | x / 1 + abs x , a smooth squashing curve | none | | nn.Tanhshrink | x - tanh x | none | | nn.Threshold | Hard threshold with a replacement value | threshold , value | | nn.Softshrink | Soft thresholding, used in sparse coding | lambd | | nn.Hardshrink | Hard thresholding | lambd | | nn.Hardsigmoid | Piecewise-linear sigmoid | inplace | | nn.Hardtanh | Clamps values into a fixed interval | min val , max val | | nn.LogSigmoid | Log of the sigmoid | none | | nn.ReLU6 | ReLU capped at 6 | inplace | | nn.RReLU | Randomized leaky ReLU during training | lower , upper , inplace | | nn.GLU | Gated linear unit over a split dimension | dim | python import svetoviz as sv def demo loss : losses = nn.ModuleDict { "L1": nn.L1Loss , "MSE": nn.MSELoss , "SmoothL1": nn.SmoothL1Loss , "Huber": nn.HuberLoss delta=1.0 , "CrossEntropy": nn.CrossEntropyLoss , "BCEWithLogits": nn.BCEWithLogitsLoss , "KLDiv": nn.KLDivLoss reduction="batchmean" , "PoissonNLL": nn.PoissonNLLLoss , "MultiLabelSoftMargin": nn.MultiLabelSoftMarginLoss , "MarginRanking": nn.MarginRankingLoss margin=0.0 , "CosineEmbedding": nn.CosineEmbeddingLoss margin=0.0 , "TripletMargin": nn.TripletMarginLoss margin=1.0, p=2.0 , "TripletMarginWithDistance": nn.TripletMarginWithDistanceLoss } def terminal callback buffer, message, images, files : for name in losses: buffer.send system message f"Loaded {name}" sv.pytorch module=losses, terminal callback=terminal callback | Module | Purpose | Key parameters | |---|---|---| | nn.L1Loss | Mean absolute error | reduction | | nn.MSELoss | Mean squared error | reduction | | nn.SmoothL1Loss | Quadratic near zero, linear in the tails | beta , reduction | | nn.HuberLoss | Huber combination of L1 and L2 | delta , reduction | | nn.CrossEntropyLoss | Log-softmax followed by NLL for class logits | weight , ignore index , label smoothing | | nn.BCEWithLogitsLoss | Sigmoid plus binary cross entropy, numerically stable | weight , pos weight , reduction | | nn.KLDivLoss | Kullback-Leibler divergence between distributions | reduction batchmean for true KL | | nn.PoissonNLLLoss | Negative log likelihood of a Poisson target | log input , full , eps | | nn.MultiLabelSoftMarginLoss | One-vs-all logistic loss for multi-label targets | weight , reduction | | nn.MarginRankingLoss | Ranking loss with a margin between pairs | margin , reduction | | nn.CosineEmbeddingLoss | Cosine distance with a target label of 1 or -1 | margin , reduction | | nn.TripletMarginLoss | Anchor / positive / negative embedding separation | margin , p , eps , swap | | nn.TripletMarginWithDistanceLoss | Triplet loss with a pluggable distance function | distance function , margin , swap | Browse every module screenshot and per-module walkthrough at https://pytorch.svetoviz.com https://pytorch.svetoviz.com . Everything in this README runs in the live viewer. You do not need to install anything to look at the public scenes, module walkthroughs and published datasets. | Destination | What is there | |---|---| | https://www.svetoviz.com https://www.svetoviz.com | Product overview, the public 3D scene directory and pricing | | https://www.svetoviz.com/docs https://www.svetoviz.com/docs | The full manuals and guides mirrored by this README | | https://pytorch.svetoviz.com https://pytorch.svetoviz.com | Illustrated per-module guides for all 114 PyTorch modules | | https://app.svetoviz.com https://app.svetoviz.com | Dataset scenes published online, browsable in the browser | The written guides published on the website, in the same order as this README: | Guide | Covers | Link | |---|---|---| | Overview | What Svetoviz is, the visual-debugger concept, supported data types | https://www.svetoviz.com/docs https://www.svetoviz.com/docs | | Installation | Package, dependency list, cache setup, demos | https://www.svetoviz.com/docs/install https://www.svetoviz.com/docs/install | | API Reference | Full signatures and parameters for every method, view, layout, remote view and utility | https://www.svetoviz.com/docs/docs https://www.svetoviz.com/docs/docs | | Images | image / images polymorphism, batch inspection, cache configuration | https://www.svetoviz.com/docs/images https://www.svetoviz.com/docs/images | | NumPy | Single array inspection, stacking, colormaps, mixed dtypes, axis ordering, large high-dimensional arrays | https://www.svetoviz.com/docs/numpy https://www.svetoviz.com/docs/numpy | | Datasets | Building and launching a dataset scene, search database, compression levels | https://www.svetoviz.com/docs/datasets https://www.svetoviz.com/docs/datasets | | Views | View vs Layout , directory views, layout nesting, offline scene building | https://www.svetoviz.com/docs/views https://www.svetoviz.com/docs/views | | torch.Tensor | Single tensor inspection, mixed dtypes, stacking, ordering, large tensors | https://www.svetoviz.com/docs/tensor https://www.svetoviz.com/docs/tensor | | Models | model vs pipeline , terminal callbacks, non-blocking mode, diffusion pipelines | https://www.svetoviz.com/docs/models https://www.svetoviz.com/docs/models | | PyTorch | Wrapping nn.Module , the interaction terminal, layer relations and provenance mapping | https://www.svetoviz.com/docs/pytorch https://www.svetoviz.com/docs/pytorch | | PyTorch Modules | The illustrated module catalog 114 modules | https://pytorch.svetoviz.com https://pytorch.svetoviz.com | | Activation functions | All 28 supported activation modules | https://www.svetoviz.com/docs/activations https://www.svetoviz.com/docs/activations | | Loss functions | All 13 supported loss modules | https://www.svetoviz.com/docs/loss https://www.svetoviz.com/docs/loss | | Demo | Link | |---|---| | NumPy array inspection | https://www.youtube.com/watch?v=fWhK4oPcSf0 https://www.youtube.com/watch?v=fWhK4oPcSf0 | | torch.Tensor inspection | https://www.youtube.com/watch?v=IijSmLB1FgY https://www.youtube.com/watch?v=IijSmLB1FgY | | PyTorch Debugger | https://www.youtube.com/watch?v=JGBud9nniOM https://www.youtube.com/watch?v=JGBud9nniOM | | Model analysis DETR | https://www.youtube.com/watch?v=SPCUtlT1298 https://www.youtube.com/watch?v=SPCUtlT1298 | | Model debugger GPT-2 | https://www.youtube.com/watch?v=LJa9MFEWcWE https://www.youtube.com/watch?v=LJa9MFEWcWE | | Dataset explorer | https://www.youtube.com/watch?v=DEuSVW1oJG4 https://www.youtube.com/watch?v=DEuSVW1oJG4 | | Image browser | https://www.youtube.com/watch?v=xHb U8BAsEs https://www.youtube.com/watch?v=xHb U8BAsEs | - Website / public directory: https://www.svetoviz.com https://www.svetoviz.com - Documentation: https://www.svetoviz.com/docs https://www.svetoviz.com/docs - PyTorch module guides: https://pytorch.svetoviz.com https://pytorch.svetoviz.com - Online datasets: https://app.svetoviz.com https://app.svetoviz.com - Python package wheel index: https://svetoviz.com/webgpu/simple/ https://svetoviz.com/webgpu/simple/ - Author - LinkedIn: https://www.linkedin.com/in/piotr-gryko-946756101/ https://www.linkedin.com/in/piotr-gryko-946756101/ - Author - GitHub: https://github.com/PiotrGryko https://github.com/PiotrGryko Svetoviz Research - advancing high-dimensional data visualization and machine learning interpretability. Piotr Gryko ul. Prezydenta Ryszarda Kaczorowskiego 14 / 271 15-375 Bialystok, Poland NIP: 9662022689 REGON: 368029613 Registered in Bialystok, Poland. www.svetoviz.com https://www.svetoviz.com | Documentation https://www.svetoviz.com/docs | PyTorch Debugger https://pytorch.svetoviz.com Built for the Global AI Research Community. Start visualizing - open the live Svetoviz viewer https://www.svetoviz.com https://www.svetoviz.com https://www.svetoviz.com - documentation, install commands, pricing and the public model / dataset browser.