Custom
The Custom Component provides a generic Component in which you can write custom Python (e.g., TensorFlow) code to transform data. This is done by using the Code Editor.
The Component's input socket must be connected to another Component that provides input data, and the output socket must be connected to another Component to output the transformed data to.
Default Code
The Custom component starts out with the following code:
Note: When you connect the input socket of your Custom Component to the output socket of another Component, PerceptiLabs will automatically remove the line:
raise TypeError("Missing input connection 'input'")
.
You will add your code to the call() method of the LayerCustom_LayerCustom_1Keras class which is invoked by PerceptiLabs to transform data when the model runs (including when PerceptiLabs runs the model as you edit it in the Modeling Tool to display previews). In general, you will add your transformation(s) between the input
and output
assignments:
Tip: You can include import
statements above the class declarations to import other Python modules.
For additional information see: How PerceptiLabs Works with TensorFlow.
Last updated