Chapter 33

systems/dna

github.com/openfluke/welvet/systems/dna


Why it exists

Quant and train must be measurable as topology/weight fingerprints — DNA detects logic shifts.

What it is

ExtractDNA, CompareNetworks, CosineSimilarity, FlattenOp / CollectStores across dtype×quant.

Go example

examples/33-dna/main.go

Run:cd welvet/examples/33-dna && source ../env.sh && go run .
package main

import (
	"fmt"

	"github.com/openfluke/welvet/architecture"
	"github.com/openfluke/welvet/core"
	"github.com/openfluke/welvet/layers/dense"
	"github.com/openfluke/welvet/systems/dna"
)

func main() {
	g := architecture.NewGrid(1, 1, 1, 1)
	l, _ := dense.New(4, 4, core.ActivationLinear, core.DTypeFloat32)
	_ = dense.Place(g, 0, 0, 0, 0, l)
	a := dna.ExtractDNA(g)
	fmt.Println(dna.CompareNetworks(a, a))
}

Output

exit 0 · last run via go run .

{1 map[0,0,0,0:1] []}