TorchLean API

NN.API.Data.Bands

Synthetic Band Dataset #

Several TorchLean examples use a compact 4×4 image classification task:

This domain module owns both the renderer and the canonical 4×4 dataset. Keeping these definitions out of TorchLean.Data.Synthetic prevents a particular image layout from becoming part of TorchLean's general tensor and sample abstractions.

Renderer #

Spatial axis along which a synthetic band varies.

Instances For
    @[implicit_reducible]

    Human-readable class name associated with an axis.

    Instances For
      def TorchLean.Data.Bands.render (channels height width : ) (value : Fin channelsFin heightFin widthFloat) :

      Render a channel-first rank-three tensor from an in-bounds scalar function.

      This shape is part of this particular dataset, not a restriction on TorchLean tensors or models.

      Instances For
        def TorchLean.Data.Bands.renderBinary (channels height width : ) (selected : Fin channelsFin heightFin widthBool) (onValue : Float := 1.0) (offValue : Float := 0.0) :

        Render a binary-valued channel-first tensor from a finite predicate.

        Instances For
          def TorchLean.Data.Bands.renderBand (height width : ) (axis : Axis) (offset : ) (thickness : := 2) (onValue : Float := 1.0) (offValue : Float := 0.0) :

          Render a single-channel horizontal or vertical band.

          Instances For

            Classes and datasets #

            Label metadata for one family of synthetic bands.

            • axis : Axis

              Axis occupied by the band.

            • label :

              Numeric class label.

            • name : String

              Display name used by reports.

            Instances For
              def TorchLean.Data.Bands.vertical (label : := 0) (name : String := "vertical") :

              Construct a vertical-band class.

              Instances For
                def TorchLean.Data.Bands.horizontal (label : := 1) (name : String := "horizontal") :

                Construct a horizontal-band class.

                Instances For
                  def TorchLean.Data.Bands.samples (height width : ) (classes : List Class) (offsets : List ) (thickness : := 2) :

                  Generate (tensor, label) samples for every class/offset pair.

                  Instances For

                    Generate named samples for reports and prediction probes.

                    Instances For

                      Canonical label set for the band dataset: vertical ↦ 0, horizontal ↦ 1.

                      Instances For

                        Typed Tensors (Tensor-First) #

                        @[reducible, inline]

                        Canonical image shape for the band dataset (single-channel 4×4).

                        Instances For

                          Training set samples: a small list of (x, label) pairs.

                          Instances For

                            Probe set for reporting: (name, x, expectedLabel) triples.

                            Instances For

                              Small vertical-versus-horizontal dataset with one-hot class targets.

                              Instances For

                                Named vertical and horizontal inputs used to inspect a trained classifier.

                                Instances For

                                  Concrete Float probe inputs for prediction examples.

                                  Instances For