{
  "id": "dreamer-v3",
  "name": "DreamerV3 World Model (RSSM)",
  "description": "Hafner et al. 2023 - the agent learns a MODEL of the environment and plans inside it. The RSSM carries a deterministic recurrent path beside a categorical stochastic latent, and everything downstream reads their concatenation, which is why the latent width is deterDim + stochDim x stochClasses and not deterDim.",
  "icon": "🌍",
  "category": "Reinforcement Learning",
  "components": [
    {
      "id": "in-obs",
      "type": "input",
      "name": "Observation (64x64 RGB)",
      "position": {
        "x": 240,
        "y": 60
      },
      "params": {
        "shape": [
          3,
          64,
          64
        ]
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "c1",
      "type": "conv2d",
      "name": "Encoder Conv 32",
      "position": {
        "x": 240,
        "y": 160
      },
      "params": {
        "inChannels": 3,
        "outChannels": 32,
        "kernelSize": 4,
        "stride": 2,
        "padding": 1
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "s1",
      "type": "swish",
      "name": "SiLU",
      "position": {
        "x": 240,
        "y": 240
      },
      "params": {},
      "inputs": [],
      "outputs": []
    },
    {
      "id": "c2",
      "type": "conv2d",
      "name": "Encoder Conv 64",
      "position": {
        "x": 240,
        "y": 320
      },
      "params": {
        "inChannels": 32,
        "outChannels": 64,
        "kernelSize": 4,
        "stride": 2,
        "padding": 1
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "s2",
      "type": "swish",
      "name": "SiLU",
      "position": {
        "x": 240,
        "y": 400
      },
      "params": {},
      "inputs": [],
      "outputs": []
    },
    {
      "id": "c3",
      "type": "conv2d",
      "name": "Encoder Conv 128",
      "position": {
        "x": 240,
        "y": 480
      },
      "params": {
        "inChannels": 64,
        "outChannels": 128,
        "kernelSize": 4,
        "stride": 2,
        "padding": 1
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "s3",
      "type": "swish",
      "name": "SiLU",
      "position": {
        "x": 240,
        "y": 560
      },
      "params": {},
      "inputs": [],
      "outputs": []
    },
    {
      "id": "c4",
      "type": "conv2d",
      "name": "Encoder Conv 256",
      "position": {
        "x": 240,
        "y": 640
      },
      "params": {
        "inChannels": 128,
        "outChannels": 256,
        "kernelSize": 4,
        "stride": 2,
        "padding": 1
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "s4",
      "type": "swish",
      "name": "SiLU",
      "position": {
        "x": 240,
        "y": 720
      },
      "params": {},
      "inputs": [],
      "outputs": []
    },
    {
      "id": "flat",
      "type": "flatten",
      "name": "flatten",
      "position": {
        "x": 240,
        "y": 800
      },
      "params": {},
      "inputs": [],
      "outputs": []
    },
    {
      "id": "rssm",
      "type": "rssm",
      "name": "RSSM (deter 512 + 32x32 stoch)",
      "position": {
        "x": 240,
        "y": 880
      },
      "params": {
        "deterDim": 512,
        "stochDim": 32,
        "stochClasses": 32,
        "hiddenDim": 512
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "dfc",
      "type": "linear",
      "name": "Decoder Projection",
      "position": {
        "x": 240,
        "y": 980
      },
      "params": {
        "inFeatures": 1536,
        "outFeatures": 4096
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "resh",
      "type": "reshape",
      "name": "to [256, 4, 4]",
      "position": {
        "x": 240,
        "y": 1060
      },
      "params": {
        "shape": [
          256,
          4,
          4
        ]
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "t1",
      "type": "transposeConv2d",
      "name": "Decoder Deconv 128",
      "position": {
        "x": 240,
        "y": 1140
      },
      "params": {
        "outChannels": 128,
        "kernelSize": 4,
        "stride": 2,
        "padding": 1
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "s5",
      "type": "swish",
      "name": "SiLU",
      "position": {
        "x": 240,
        "y": 1220
      },
      "params": {},
      "inputs": [],
      "outputs": []
    },
    {
      "id": "t2",
      "type": "transposeConv2d",
      "name": "Decoder Deconv 64",
      "position": {
        "x": 240,
        "y": 1300
      },
      "params": {
        "outChannels": 64,
        "kernelSize": 4,
        "stride": 2,
        "padding": 1
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "s6",
      "type": "swish",
      "name": "SiLU",
      "position": {
        "x": 240,
        "y": 1380
      },
      "params": {},
      "inputs": [],
      "outputs": []
    },
    {
      "id": "t3",
      "type": "transposeConv2d",
      "name": "Decoder Deconv 32",
      "position": {
        "x": 240,
        "y": 1460
      },
      "params": {
        "outChannels": 32,
        "kernelSize": 4,
        "stride": 2,
        "padding": 1
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "s7",
      "type": "swish",
      "name": "SiLU",
      "position": {
        "x": 240,
        "y": 1540
      },
      "params": {},
      "inputs": [],
      "outputs": []
    },
    {
      "id": "t4",
      "type": "transposeConv2d",
      "name": "Decoder Deconv 3",
      "position": {
        "x": 240,
        "y": 1620
      },
      "params": {
        "outChannels": 3,
        "kernelSize": 4,
        "stride": 2,
        "padding": 1
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "out",
      "type": "output",
      "name": "reconstructed frame",
      "position": {
        "x": 240,
        "y": 1700
      },
      "params": {},
      "inputs": [],
      "outputs": []
    }
  ],
  "connections": [
    {
      "id": "c1",
      "from": "in-obs",
      "to": "c1",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c2",
      "from": "c1",
      "to": "s1",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c3",
      "from": "s1",
      "to": "c2",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c4",
      "from": "c2",
      "to": "s2",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c5",
      "from": "s2",
      "to": "c3",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c6",
      "from": "c3",
      "to": "s3",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c7",
      "from": "s3",
      "to": "c4",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c8",
      "from": "c4",
      "to": "s4",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c9",
      "from": "s4",
      "to": "flat",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c10",
      "from": "flat",
      "to": "rssm",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c11",
      "from": "rssm",
      "to": "dfc",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c12",
      "from": "dfc",
      "to": "resh",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c13",
      "from": "resh",
      "to": "t1",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c14",
      "from": "t1",
      "to": "s5",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c15",
      "from": "s5",
      "to": "t2",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c16",
      "from": "t2",
      "to": "s6",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c17",
      "from": "s6",
      "to": "t3",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c18",
      "from": "t3",
      "to": "s7",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c19",
      "from": "s7",
      "to": "t4",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c20",
      "from": "t4",
      "to": "out",
      "fromPort": "bottom",
      "toPort": "top"
    }
  ]
}