TensorSpace.js
Getting Start
Basic Concepts
Model Preprocessing
Models
Layers
Merge Function
GreyscaleInput
Create an Input layer. Input2d is used for the greyscale image format input.
Constructor
TSP.layers.Input2d( { shape : [ Int, Int ] } );
Fig. 1 - Greyscale Input layer
Arguments

Name

Tag

Type

Instruction

Usage Notes and Examples

shape

⭐📦️

Int[] shape of output dataFormat is channel last. For example, shape = [ 28, 28 ] represents shape of input image is 28 by 28.

name

🔧

String Name of this layer. Highly recommend to arrange to make code more readable. name: "layerName"

color

⚙️🎨️

color format Color of layer GreyscaleInput default is #EEEEEE

closeButton

⚙️🎨️

Dict Close button appearance control dict, more about close button

display : Boolean. true[default] Show button, false Hide button

ratio : Int. Times to normal size, default is 1

For example, 2 means twice the normal size

initStatus

⚙️️🎦

String Layer status at beginning. Open or Close close[default] : Closed at beginning

animation-
TimeRatio

⚙️🎦️

Int The speed of open and close animation Integer for multiple of speed. For example, 2 for 2 times of basic speed.
Properties
.outputShape : Int[]
filter_center_focusThe shape of output tensor is 2-dimensional. 2️⃣
filter_center_focusThe shape of output tensor is 2-dimensional. For example outputShape = [ 32, 32 ] represents shape of output map is 32 by 32.
filter_center_focusAfter model.init() data is available, otherwise is undefined.
.neuralValue : Int[]
filter_center_focusThe intermediate raw data after this layer.
filter_center_focusAfter load and model.predict() data is available, otherwise is undefined.
.name : String
filter_center_focusThe custom name for this layer.
filter_center_focusOnce created, you can get it.
.layerType : String
filter_center_focusType of this layer, return a constant: string GreyscaleInput.
filter_center_focusOnce created, you can get it.
Example
filter_center_focus Declare an instance of GreyscaleInput to facilitate reuse
let inputLayer = new TSP.layers.GreyscaleInput( {

    shape: [ 100, 100 ],
    name: "GreyscaleInput1",
    initStatus: "open"

} );
model.add( inputLayer );
filter_center_focusAdd GreyscaleInput directly
model.add( new TSP.layers.GreyscaleInput( {

    shape: [ 100, 100 ],
    name: "GreyscaleInput2"

} ) );
Tag Lookup
Tag Icon Meaning Instruction
⭐️ Required Must be provided, cannot be empty. Meanwhile constructor works properly if this arguments provided. Control arguments use default value.
🔧 Suggest Recommended for giving. The API can work without them.
⚙️ Optional As an auxiliary adjustment parameter when used, selectively added according to the specific situation The parameters here have no effect on the structure of the layer (3D visualized form).
📦 Model Configure the properties of the Layer. It changes the output shape.
🎨 Style Override the properties in TSP.model (model configuration)
🎦 Animation Override the properties in TSP.model (model configuration)
Source Code
tensorspace/src/layer/input/GreyscaleInput.js