Skip to content

Model Import

Jordan Welsman edited this page Feb 13, 2023 · 4 revisions

nexport.nimport()

This function allows users to import a model saved with nexport.export() by simply pointing to a file. It returns a fully rebuilt model object at assignment.

Usage

import nexport

model = nexport.nimport(filepath="model.json",
                   verbose=1
)

Arguments

Argument Data type Default Description
filepath string Path to file containing the exported model's parameters
verbose integer 1 Degree of status output for model construction

filepath

This is the path to a file previously generated by nexport.export(). If the file has been generated with anything other than nexport (such as pickle), this function will likely not be able to construct the contained model.

verbose

This is the degree of verbosity the function should output to when reporting the export status. There are currently four levels of verbosity:

  • 0: Status reporting disabled. No output to console when constructing
  • 1: Status reported when model has been successfully constructed and returned.
  • 2: Status reported when INSERT REQUIREMENTS HERE, in addition to all updates in 1.
  • 3: Status reported INSERT REQUIREMENTS HERE, in addition to all updates in 2.

Accepted arguments

Argument Required Accepted values
filepath Any string pointing to a file with a supported filetype
verbose 0, 1, 2, 3

Returns

This function returns a fully-constructed dense neural network, and as such, should be called under assignment to an object, like in this example.

Side-effects

Despite having the sole purpose of returning an object, this function outputs status updates to the terminal depending on the degree of verbosity passed.