

.. _sphx_glr_usage_examples_flow:

============
Flow
============

These examples cover flow-style visualization


.. raw:: html

  <div id='sg-tag-list' class='sphx-glr-tag-list'></div>


.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Visualization of 2D view">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_2d_view_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_2d_view`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">2D View</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Visualization of basic custom model">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_basic_custom_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_basic_custom`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Basic Custom</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Visualization of basic sequential model">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_basic_sequential_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_basic_sequential`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Basic Sequential</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Visualization of custom color. The synthetic input box can be recolored too, keyed by visualtorch.Input in color_map just like any real layer type - left uncustomized, it would default to the same color as Conv2d here, since both would otherwise claim the same slot in the color wheel.">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_custom_color_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_custom_color`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom Color</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Change the color transparency">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_custom_opacity_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_custom_opacity`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom Opacity</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Visualization of custom orientation for 1 dim layers">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_custom_orientation_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_custom_orientation`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom Orientation</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Visualization of custom shading">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_custom_shading_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_custom_shading`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom Shading</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Visualization of custom spacing">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_custom_spacing_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_custom_spacing`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom Spacing</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="background_fill isn&#x27;t limited to plain white - it also accepts a transparent color (e.g. (0, 0, 0, 0)), useful for dropping a figure onto a paper/slide without a white box around it, or an opaque dark color for a nicer look on dark-mode pages.">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_dark_background_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_dark_background`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Dark Background</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Visualize some layers only. type_ignore hides layer types you don&#x27;t care about (here, ReLU and Flatten); show_input=False is the same idea applied to the synthetic input box itself - both trim the diagram down to just the layers worth looking at.">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_ignore_layers_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_ignore_layers`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Ignore Layers</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The same Inception-style block as the graph style&#x27;s multi-branch example - four parallel branches (a plain Conv2d+BatchNorm2d, a 1x1-then-3x3 conv, a 1x1-then-5x5 conv, and a max-pool-then-1x1-conv) that all read the same input and merge into a shared projection layer - rendered in flow style instead.">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_inception_block_flow_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_inception_block_flow`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multi-Branch Merge (Inception-style)</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The same two-branch model as the graph style&#x27;s multi-input example - an image branch (Conv2d + global pooling) and a tabular-vector branch (a small MLP), merged by concatenation before a shared head - rendered in flow style instead.">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_multi_input_flow_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_multi_input_flow`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multi-Input Model (Siamese-style)</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The same real, torchvision-provided resnet18 architecture as the graph style&#x27;s example - 8 residual blocks across 4 stages, with a projection shortcut where channels/spatial size change - rendered in flow style instead.">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_resnet18_flow_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_resnet18_flow`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">ResNet-18</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Visualization of a classic ResNet-style residual block: Conv2d + BatchNorm2d, twice, with a plain identity shortcut around them and a final ReLU.">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_residual_block_flow_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_residual_block_flow`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Residual Block</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The same small U-Net as the graph style&#x27;s example, rendered in flow style instead - the contracting-then-expanding channel/spatial shape naturally produces the classic U-Net silhouette.">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_unet_flow_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_unet_flow`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">U-Net</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The same small Vision Transformer as the graph style&#x27;s ViT example, rendered in flow style instead. This is a deep, narrow model (many similarly-sized sequential layers), which flow&#x27;s volumetric look tends to render busier/harder to visually parse than graph - included here for completeness, but graph is the clearer choice for this kind of architecture.">

.. only:: html

  .. image:: /usage_examples/flow/images/thumb/sphx_glr_plot_vit_flow_thumb.png
    :alt:

  :doc:`/usage_examples/flow/plot_vit_flow`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Vision Transformer (ViT)</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /usage_examples/flow/plot_2d_view
   /usage_examples/flow/plot_basic_custom
   /usage_examples/flow/plot_basic_sequential
   /usage_examples/flow/plot_custom_color
   /usage_examples/flow/plot_custom_opacity
   /usage_examples/flow/plot_custom_orientation
   /usage_examples/flow/plot_custom_shading
   /usage_examples/flow/plot_custom_spacing
   /usage_examples/flow/plot_dark_background
   /usage_examples/flow/plot_ignore_layers
   /usage_examples/flow/plot_inception_block_flow
   /usage_examples/flow/plot_multi_input_flow
   /usage_examples/flow/plot_resnet18_flow
   /usage_examples/flow/plot_residual_block_flow
   /usage_examples/flow/plot_unet_flow
   /usage_examples/flow/plot_vit_flow

