TensorSpace.js
Getting Start
Basic Concepts
Model Preprocessing
Models
Layers
Merge Function
Input1d
Create an Input layer. Input1d is used for the 1-dimensional data input.
Constructor
TSP.layers.Input1d( { shape : [ Int ] } );
Fig. 1 - Input1d layer
Arguments

Name

Tag

Type

Instruction

Usage Notes and Examples

shape

⭐📦️

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

paging

🎨🔧️

Bool Enable Pagination, more about paging Since the long 1D layer could make the model hard to visualize, we use paging. true Enable; false [Default] Disable

segmentLength

🎨⚙️️

Int Amount of nodes in one page, only take effect when "paging" is enabled 200[Default] 200 nodes in each page

segmentIndex

🎨⚙️️

Int The initial start index of first page, only take effect when "paging" is enabled 0[Default]

overview

🎨⚙️️

Bool Look layer Text from different angle, more about overview false[Default]

name

🔧

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

color

⚙️🎨️

color format Color of layer Input1d 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

animeTime

⚙️🎦️

Int The speed of open and close animation For example, 2000 means 2 seconds. Note: Configure animeTime in a specific layer will override model's animeTime configuration.
Properties
.outputShape : Int[]
filter_center_focusThe shape of output tensor is 1-dimensional. 1️⃣
filter_center_focusThe shape of output tensor. For example outputShape = [ 1000 ] represents the output through this layer has 1000 outputs.
filter_center_focusAfter model.init() data is available, otherwise is undefined.
.neuralValue : Float[]
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 Input1d.
filter_center_focusOnce created, you can get it.
Example
filter_center_focus Declare an instance of Input1d to facilitate reuse
let inputLayer = new TSP.layers.Input1d( {

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

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

    shape: [ 100 ],
    name: "Input1d2"

} ) );
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/input1d.js