This tutorial explains
from rztdl.dl.model import RZTModel
from rztdl.dl.components.layers import Input, Dense
from rztdl.dl.components.losses import BinaryCrossentropy
from rztdl.dl.optimizers import Adam
Using default configs as no custom logging config was provided
model = RZTModel(name="binary_classifier")
model.add(Input(shape=[4], name="Input_Image"))
model.add(Dense(units=16, name="dense1"))
model.add(Dense(units=4, name="dense2"))
model.add(Dense(units=1, name="dense3", outputs="dense_out"))
model.add(Input(shape=[1], name="Label"))
model.add(BinaryCrossentropy(name="nll",predictions="dense_out", labels="Label" ))
model.add(Adam(name="adam"))
INFO:rztdl.dl.model:Input Layer 'Input_Image' validated successfully
INFO:rztdl.dl.model:Dense Layer 'dense1' validated successfully
INFO:rztdl.dl.model:Dense Layer 'dense2' validated successfully
INFO:rztdl.dl.model:Dense Layer 'dense3' validated successfully
INFO:rztdl.dl.model:Input Layer 'Label' validated successfully
INFO:rztdl.dl.model:BinaryCrossentropy Loss 'nll' validated successfully
INFO:rztdl.dl.model:Adam Optimizer 'adam' validated successfully
from razor.api import dlmodels
dlmodels.export_model(model)
{'id': '0db137e1-aa0d-4013-824e-e1bd3b9aa9ef',
'name': 'binary_classifier',
'description': '',
'createdOn': '2020-10-09T10:34:25.573+0530',
'createdBy': 'Sunil Vengalil V',
'modifiedBy': 'Sunil Vengalil V',
'modifiedOn': '2020-10-09T10:34:25.573+0530',
'validationResponse': {'validModel': True,
'model': {'warnings': None,
'error': [],
'slots': None,
'parameters': None,
'iterations': None,
'sharedComponentDetail': None},
'blocks': {},
'groups': {},
'stacks': {},
'deletedComponents': None,
'updatedComponents': None,
'grayLogSaveId': '8d9e10bd-bec9-46ec-98ae-b3298cc1049c'},
'version': None,
'template': None,
'publishStatus': None,
'framework': {'frameworkVersion': '3.0',
'baseInstallationPath': '/bigbrain/python_libs/BBDL_FRAMEWORK/3.0/',
'tfHubModelsPath': '/bigbrain/python_libs/BBDL_FRAMEWORK/3.0/tf_hub_models/'},
'daysToResolve': None,
'libraryDetailList': None,
'valid': True}
The model with name binary_classifier
start appearing in the DL model designer page and can be used like any other model created using model designer
imported_model = dlmodels.import_model("binary_classifier")
INFO:root:TF Version 2.1.0
INFO:root:RZTDL Version 3.1.14
INFO:root:Parser Version 3.1.14
INFO:rztdl.dl.model:Input Layer 'Label' validated successfully
INFO:rztdl.dl.model:Input Layer 'Input_Image' validated successfully
INFO:rztdl.dl.model:Dense Layer 'dense1' validated successfully
INFO:rztdl.dl.model:Dense Layer 'dense2' validated successfully
INFO:rztdl.dl.model:Dense Layer 'dense3' validated successfully
INFO:rztdl.dl.model:BinaryCrossentropy Loss 'nll' validated successfully
INFO:rztdl.dl.model:Adam Optimizer 'adam' validated successfully
<rztdl.dl.model.RZTModel at 0x7f98c4657dd0>
One can create a pipeline using imported_model
and initiate a train/inferene/evaluation flow