Skip to content

Supported File Formats

Jordan Welsman edited this page Jan 11, 2023 · 5 revisions

Summary

nexport PyTorch Keras/TensorFlow
.txt .json .csv .xml .txt .json .csv .xml
Currently supported Yes Yes No No WIP No No No
Planned support version 0.1.0 0.2.0 0.6.0 0.7.0 0.4.0 0.5.0 0.6.0 0.7.0

Example network

This is the network used to show examples of each file structure. It was generated using NN SVG, a tool written by Alex Lenail.

View example network

Text document (.txt)

The text document was the first format to be supported by nexport (since as it was simply just a dump of the model's parameters. However, the format

Example file

View example
[[-0.7, 0.6]
 [-0.1, -0.4]
 [0.5, -0.8]]

[-0.1, 0.8, -0.2]


[[-0.9, 0.2, 0.8]]

[0.3]

JavaScript Object Notation file (.json)

JSON was chosen as the next file format to receive support due to its human-readability. This also drove the switch from .txt in inference-engine as the network structure is more apparent at first glance.

Example file

View example
{
  "hidden_layers": [
    [
      {
        "weights": [
          -0.7,
          0.6
        ],
        "bias": -0.1
      },
      {
        "weights": [
          -0.1,
          -0.4
        ],
        "bias": 0.8
      },
      {
        "weights": [
          0.5,
          -0.8
        ],
        "bias": -0.2
      }
    ]
  ],
  "output_layer": [
    {
      "weights": [
        -0.9,
        0.2,
        0.8
      ],
      "bias": 0.3
    }
  ]
}

Comma-Separated Value file (.csv)

Example file

View example

File structure does not yet exist.

Extensible Markup Language file (.xml)

Example file

View example

File structure does not yet exist.