{
  "id": "patch-tst",
  "name": "PatchTST",
  "description": "Channel-independent patching + Transformer for multivariate time-series classification/forecasting (Nie et al. 2023).",
  "components": [
    {
      "id": "input-1",
      "type": "input",
      "name": "ts_window",
      "position": { "x": 220, "y": 50 },
      "params": { "shape": [1, 22, 1000] },
      "inputs": [], "outputs": []
    },
    {
      "id": "patch-embed",
      "type": "patchEmbed",
      "name": "patch_embed",
      "scope": "embeddings",
      "position": { "x": 220, "y": 220 },
      "params": { "patchSize": 16, "stride": 8, "embedDim": 128 },
      "inputs": [], "outputs": []
    },
    {
      "id": "pos-enc",
      "type": "positionalEncoding",
      "name": "pos_embed",
      "scope": "embeddings",
      "position": { "x": 220, "y": 390 },
      "params": { "maxLen": 256, "embedDim": 128 },
      "inputs": [], "outputs": []
    },
    {
      "id": "norm-attn-1",
      "type": "layerNorm",
      "name": "norm",
      "scope": "encoder.layer.0.attention",
      "position": { "x": 220, "y": 560 },
      "params": { "normalizedShape": 128 },
      "inputs": [], "outputs": []
    },
    {
      "id": "mha-1",
      "type": "multiHeadAttention",
      "name": "self_attn",
      "scope": "encoder.layer.0.attention",
      "position": { "x": 220, "y": 730 },
      "params": { "embedDim": 128, "numHeads": 16 },
      "inputs": [], "outputs": []
    },
    {
      "id": "res-attn-1",
      "type": "add",
      "name": "residual",
      "scope": "encoder.layer.0.attention",
      "position": { "x": 220, "y": 900 },
      "params": {},
      "inputs": [], "outputs": []
    },
    {
      "id": "norm-ffn-1",
      "type": "layerNorm",
      "name": "norm",
      "scope": "encoder.layer.0.ffn",
      "position": { "x": 220, "y": 1070 },
      "params": { "normalizedShape": 128 },
      "inputs": [], "outputs": []
    },
    {
      "id": "ffn-1",
      "type": "feedForward",
      "name": "dense",
      "scope": "encoder.layer.0.ffn",
      "position": { "x": 220, "y": 1240 },
      "params": { "embedDim": 128, "ffDim": 256 },
      "inputs": [], "outputs": []
    },
    {
      "id": "res-ffn-1",
      "type": "add",
      "name": "residual",
      "scope": "encoder.layer.0.ffn",
      "position": { "x": 220, "y": 1410 },
      "params": {},
      "inputs": [], "outputs": []
    },
    {
      "id": "norm-attn-2",
      "type": "layerNorm",
      "name": "norm",
      "scope": "encoder.layer.1.attention",
      "position": { "x": 220, "y": 1580 },
      "params": { "normalizedShape": 128 },
      "inputs": [], "outputs": []
    },
    {
      "id": "mha-2",
      "type": "multiHeadAttention",
      "name": "self_attn",
      "scope": "encoder.layer.1.attention",
      "position": { "x": 220, "y": 1750 },
      "params": { "embedDim": 128, "numHeads": 16 },
      "inputs": [], "outputs": []
    },
    {
      "id": "res-attn-2",
      "type": "add",
      "name": "residual",
      "scope": "encoder.layer.1.attention",
      "position": { "x": 220, "y": 1920 },
      "params": {},
      "inputs": [], "outputs": []
    },
    {
      "id": "norm-ffn-2",
      "type": "layerNorm",
      "name": "norm",
      "scope": "encoder.layer.1.ffn",
      "position": { "x": 220, "y": 2090 },
      "params": { "normalizedShape": 128 },
      "inputs": [], "outputs": []
    },
    {
      "id": "ffn-2",
      "type": "feedForward",
      "name": "dense",
      "scope": "encoder.layer.1.ffn",
      "position": { "x": 220, "y": 2260 },
      "params": { "embedDim": 128, "ffDim": 256 },
      "inputs": [], "outputs": []
    },
    {
      "id": "res-ffn-2",
      "type": "add",
      "name": "residual",
      "scope": "encoder.layer.1.ffn",
      "position": { "x": 220, "y": 2430 },
      "params": {},
      "inputs": [], "outputs": []
    },
    {
      "id": "norm-final",
      "type": "layerNorm",
      "name": "norm",
      "scope": "head",
      "position": { "x": 220, "y": 2600 },
      "params": { "normalizedShape": 128 },
      "inputs": [], "outputs": []
    },
    {
      "id": "flatten-1",
      "type": "flatten",
      "name": "flatten",
      "scope": "head",
      "position": { "x": 220, "y": 2770 },
      "params": {},
      "inputs": [], "outputs": []
    },
    {
      "id": "linear-1",
      "type": "linear",
      "name": "classifier",
      "scope": "head",
      "position": { "x": 220, "y": 2940 },
      "params": { "outFeatures": 4 },
      "inputs": [], "outputs": []
    },
    {
      "id": "output-1",
      "type": "output",
      "name": "logits",
      "position": { "x": 220, "y": 3110 },
      "params": {},
      "inputs": [], "outputs": []
    }
  ],
  "connections": [
    { "id": "c1",  "from": "input-1",      "to": "patch-embed" },
    { "id": "c2",  "from": "patch-embed",  "to": "pos-enc" },
    { "id": "c3",  "from": "pos-enc",      "to": "norm-attn-1" },
    { "id": "c4",  "from": "norm-attn-1",  "to": "mha-1" },
    { "id": "c5",  "from": "mha-1",        "to": "res-attn-1" },
    { "id": "c6",  "from": "pos-enc",      "to": "res-attn-1" },
    { "id": "c7",  "from": "res-attn-1",   "to": "norm-ffn-1" },
    { "id": "c8",  "from": "norm-ffn-1",   "to": "ffn-1" },
    { "id": "c9",  "from": "ffn-1",        "to": "res-ffn-1" },
    { "id": "c10", "from": "res-attn-1",   "to": "res-ffn-1" },
    { "id": "c11", "from": "res-ffn-1",    "to": "norm-attn-2" },
    { "id": "c12", "from": "norm-attn-2",  "to": "mha-2" },
    { "id": "c13", "from": "mha-2",        "to": "res-attn-2" },
    { "id": "c14", "from": "res-ffn-1",    "to": "res-attn-2" },
    { "id": "c15", "from": "res-attn-2",   "to": "norm-ffn-2" },
    { "id": "c16", "from": "norm-ffn-2",   "to": "ffn-2" },
    { "id": "c17", "from": "ffn-2",        "to": "res-ffn-2" },
    { "id": "c18", "from": "res-attn-2",   "to": "res-ffn-2" },
    { "id": "c19", "from": "res-ffn-2",    "to": "norm-final" },
    { "id": "c20", "from": "norm-final",   "to": "flatten-1" },
    { "id": "c21", "from": "flatten-1",    "to": "linear-1" },
    { "id": "c22", "from": "linear-1",     "to": "output-1" }
  ]
}
