Documentation

LeanMlir.Proofs.Nets.MobileNet.MobileNetV4FullBDrop

MobileNetV4-Conv-M with stochastic depth and classifier dropout — forward, graph, faithfulness #

MobileNetV4FullB states the net and its classifier-dropout form (mnv4FwdGraphBFullDo). The paper-tier train steps mnv4in_acc{,dp}8x128wxdropdowd01bf16 also carry stochastic depth (sd, the %dp<k> inputs): a per-example scale dropPath on the residual BRANCH, after the project BN and before the skip add, at each of the eighteen skip rows. Site k is the k-th skip row in table order (the renderer's mnv4DropSites):

site01–78–17
rows24–1012–21

The three strided rows (1, 3, 11) have no skip and no site. This file states that forward with both regularisers, as the renderer's uibFwdSkipB … (drop := some k) and mnv4HeadFwdB … (cd := true) emit them, and proves the typed graph denotes it:

Those two artifacts are bf16; this is their f32 form, as mnv4FwdGraphBFullDo is for the classifier-dropout ones. The train steps' backward through the drop sites is outside this statement, as it is outside MobileNetV4StepTieB.

Why a separate file, and why rw. MobileNetV4FullB's group graphs are private and their whole-net proof is the one whose simp only spelling dies in the kernel, so the drop-carrying groups are new definitions here rather than edits there. Every group and whole-net step below is an outside-in rw with a faithfulness lemma of the shape den <subgraph> = <sub>.fwd (den ·), so den never meets a literal-width term it could start evaluating.

References #

noncomputable def Proofs.StableHLO.mnv4SkipDrop {N n : ℕ} (f : Vec (N * n) → Vec (N * n)) (s : Vec N) :
Vec (N * n) → Vec (N * n)

A skip row with its stochastic-depth site: the body's output scaled per example by s, then the identity skip — the reference's x + _drop_branch(body(x)).

Equations
Instances For
    theorem Proofs.StableHLO.mnv4SkipDrop_ones {N n : ℕ} (f : Vec (N * n) → Vec (N * n)) :
    (mnv4SkipDrop f fun (x : Fin N) => 1) = residual f

    At the all-ones scale the drop-carrying skip row is the plain one.

    def Proofs.StableHLO.mnv4SkipDropGraphB {N n : ℕ} (mN : String) (s : Vec N) (body : SHlo (N * n) → SHlo (N * n)) (e : SHlo (N * n)) :
    SHlo (N * n)

    A skip row's graph with its drop site: mnv4SkipGraphB with a dropPathB on the body's output, mask input mN (the renderer's is dpName k). Like mnv4SkipGraphB, a named combinator so the block input occurs once in the whole-net term.

    Equations
    Instances For
      theorem Proofs.StableHLO.mnv4SkipDropGraphB_faithful {N n : ℕ} (mN : String) (s : Vec N) (body : SHlo (N * n) → SHlo (N * n)) (f : Vec (N * n) → Vec (N * n)) (hb : ∀ (e' : SHlo (N * n)), den (body e') = f (den e')) (e : SHlo (N * n)) :
      den (mnv4SkipDropGraphB mN s body e) = mnv4SkipDrop f s (den e)

      A drop-carrying skip row denotes mnv4SkipDrop of whatever its body denotes — generic in both, so one theorem covers all eighteen.

      noncomputable def Proofs.StableHLO.mnv4Res28Drop (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (v : Vec (N * (48 * 56 * 56))) :
      Vec (N * (80 * 28 * 28))

      Trunk group Res28 with its drop site: row 2 reads site 0.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        noncomputable def Proofs.StableHLO.mnv4Res14aDrop (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (v : Vec (N * (80 * 28 * 28))) :
        Vec (N * (160 * 14 * 14))

        Trunk group Res14a with its drop sites: rows 4–6 read sites 1–3.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          noncomputable def Proofs.StableHLO.mnv4Res14bDrop (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (v : Vec (N * (160 * 14 * 14))) :
          Vec (N * (160 * 14 * 14))

          Trunk group Res14b with its drop sites: rows 7–10 read sites 4–7.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            noncomputable def Proofs.StableHLO.mnv4Res7aDrop (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (v : Vec (N * (160 * 14 * 14))) :
            Vec (N * (256 * 7 * 7))

            Trunk group Res7a with its drop sites: rows 12–15 read sites 8–11.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              noncomputable def Proofs.StableHLO.mnv4Res7bDrop (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (v : Vec (N * (256 * 7 * 7))) :
              Vec (N * (256 * 7 * 7))

              Trunk group Res7b with its drop sites: rows 16–21 read sites 12–17.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                At the all-ones masks each group is its CertLayer's forward. Stated against the *_fwd_apply expansions, where the terms are variables.

                theorem Proofs.StableHLO.mnv4Res28Drop_ones (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (v : Vec (N * (48 * 56 * 56))) :
                mnv4Res28Drop N w (fun (x : Fin 18) (x_1 : Fin N) => 1) v = (mnv4Res28Layer N w).fwd v
                theorem Proofs.StableHLO.mnv4Res14aDrop_ones (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (v : Vec (N * (80 * 28 * 28))) :
                mnv4Res14aDrop N w (fun (x : Fin 18) (x_1 : Fin N) => 1) v = (mnv4Res14aLayer N w).fwd v
                theorem Proofs.StableHLO.mnv4Res14bDrop_ones (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (v : Vec (N * (160 * 14 * 14))) :
                mnv4Res14bDrop N w (fun (x : Fin 18) (x_1 : Fin N) => 1) v = (mnv4Res14bLayer N w).fwd v
                theorem Proofs.StableHLO.mnv4Res7aDrop_ones (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (v : Vec (N * (160 * 14 * 14))) :
                mnv4Res7aDrop N w (fun (x : Fin 18) (x_1 : Fin N) => 1) v = (mnv4Res7aLayer N w).fwd v
                theorem Proofs.StableHLO.mnv4Res7bDrop_ones (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (v : Vec (N * (256 * 7 * 7))) :
                mnv4Res7bDrop N w (fun (x : Fin 18) (x_1 : Fin N) => 1) v = (mnv4Res7bLayer N w).fwd v
                noncomputable def Proofs.StableHLO.mobilenetv4ForwardBFullDrop (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (m : Vec (N * 1280)) (x : Vec (N * (3 * 224 * 224))) :
                Vec (N * nCls)

                MobileNetV4-Conv-M with stochastic depth and classifier dropout: mobilenetv4ForwardBFullDo with sd's eighteen per-example scales on the skip rows' branches (site k = the k-th skip row, the module's table) and m before the classifier.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem Proofs.StableHLO.mobilenetv4ForwardBFullDrop_sdOnes (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (m : Vec (N * 1280)) (x : Vec (N * (3 * 224 * 224))) :
                  mobilenetv4ForwardBFullDrop N w (fun (x : Fin 18) (x_1 : Fin N) => 1) m x = mobilenetv4ForwardBFullDo N w m x

                  At the all-ones drop masks the forward is the classifier-dropout forward.

                  theorem Proofs.StableHLO.mobilenetv4ForwardBFullDrop_ones (N : ℕ) {nCls : ℕ} (w : Mnv4BWeights nCls) (x : Vec (N * (3 * 224 * 224))) :
                  mobilenetv4ForwardBFullDrop N w (fun (x : Fin 18) (x_1 : Fin N) => 1) (fun (x : Fin (N * 1280)) => 1) x = mobilenetv4ForwardBFull N w x

                  At the all-ones masks the forward is mobilenetv4ForwardBFull, exactly.

                  def Proofs.StableHLO.mnv4Res28DropGraphB (N : ℕ) (epsStr : String) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (e : SHlo (N * (48 * 56 * 56))) :
                  SHlo (N * (80 * 28 * 28))

                  Trunk group Res28's graph with its drop site.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem Proofs.StableHLO.mnv4Res28DropGraphB_faithful (N : ℕ) (epsStr : String) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (e : SHlo (N * (48 * 56 * 56))) :
                    den (mnv4Res28DropGraphB N epsStr w sd e) = mnv4Res28Drop N w sd (den e)
                    def Proofs.StableHLO.mnv4Res14aDropGraphB (N : ℕ) (epsStr : String) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (e : SHlo (N * (80 * 28 * 28))) :
                    SHlo (N * (160 * 14 * 14))

                    Trunk group Res14a's graph with its drop sites.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem Proofs.StableHLO.mnv4Res14aDropGraphB_faithful (N : ℕ) (epsStr : String) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (e : SHlo (N * (80 * 28 * 28))) :
                      den (mnv4Res14aDropGraphB N epsStr w sd e) = mnv4Res14aDrop N w sd (den e)
                      def Proofs.StableHLO.mnv4Res14bDropGraphB (N : ℕ) (epsStr : String) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (e : SHlo (N * (160 * 14 * 14))) :
                      SHlo (N * (160 * 14 * 14))

                      Trunk group Res14b's graph with its drop sites.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        theorem Proofs.StableHLO.mnv4Res14bDropGraphB_faithful (N : ℕ) (epsStr : String) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (e : SHlo (N * (160 * 14 * 14))) :
                        den (mnv4Res14bDropGraphB N epsStr w sd e) = mnv4Res14bDrop N w sd (den e)
                        def Proofs.StableHLO.mnv4Res7aDropGraphB (N : ℕ) (epsStr : String) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (e : SHlo (N * (160 * 14 * 14))) :
                        SHlo (N * (256 * 7 * 7))

                        Trunk group Res7a's graph with its drop sites.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem Proofs.StableHLO.mnv4Res7aDropGraphB_faithful (N : ℕ) (epsStr : String) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (e : SHlo (N * (160 * 14 * 14))) :
                          den (mnv4Res7aDropGraphB N epsStr w sd e) = mnv4Res7aDrop N w sd (den e)
                          def Proofs.StableHLO.mnv4Res7bDropGraphB (N : ℕ) (epsStr : String) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (e : SHlo (N * (256 * 7 * 7))) :
                          SHlo (N * (256 * 7 * 7))

                          Trunk group Res7b's graph with its drop sites.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            theorem Proofs.StableHLO.mnv4Res7bDropGraphB_faithful (N : ℕ) (epsStr : String) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (e : SHlo (N * (256 * 7 * 7))) :
                            den (mnv4Res7bDropGraphB N epsStr w sd e) = mnv4Res7bDrop N w sd (den e)
                            def Proofs.StableHLO.mnv4FwdGraphBFullDrop (N : ℕ) (epsStr mName : String) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (m : Vec (N * 1280)) (e : SHlo (N * (3 * 224 * 224))) :
                            SHlo (N * nCls)

                            The MobileNetV4-Conv-M forward graph with stochastic depth and classifier dropout — the f32 typed form of the forward half of mnv4in_acc{,dp}8x128wxdropdowd01bf16: each skip row's drop site reads %dp<k> at its site index k, the classifier dropout the input mName (the render's is doName).

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              theorem Proofs.StableHLO.mnv4FwdGraphBFullDrop_faithful (N : ℕ) (epsStr mName : String) {nCls : ℕ} (w : Mnv4BWeights nCls) (sd : Fin 18 → Vec N) (m : Vec (N * 1280)) (e : SHlo (N * (3 * 224 * 224))) :
                              den (mnv4FwdGraphBFullDrop N epsStr mName w sd m e) = mobilenetv4ForwardBFullDrop N w sd m (den e)

                              The graph denotes the forward, at every pair of masks — eight outside-in rewrites, as mnv4FwdGraphBFullDo_faithful.