TensorSpace.js
Getting Start
Basic Concepts
TensorSpace Converter
Model Preprocessing
Models
Layers
Merge Function
Close Button
The CloseButton is one of the important elements of the Layer.
Based on our specific requirements, we can customize the CloseButton. For example, we can config the CloseButton like:
new TSP.layers.Conv2d( {
    ...

    closeButton: {
        display: true,
        ratio: 2
    }

    ...
} );
By default, display is true, which indicates the button is displayed close to the feature maps when the layer is expanded:
Fig. 1 - CloseButton
After clicking the CloseButton, the layer collapse to the aggregation status and the CloseButton will be hidden.
Fig. 2 - Collapsed Layer
The CloseButton size is calculated based on the size of the layer automatically. If we want to modify the button manually, we can config the ratio which indicates the ratio between the actual object and the base object.
By default, the ratio is set to 1:
Fig. 3 - CloseButton with ratio 1 (default)
We can make the button larger to set the ratio to 3:
Fig. 4 - CloseButton with ratio 3
If you do not like our lovely CloseButton, we can set the display to be false and there will be no CloseButton displayed.
Fig. 5 - Don't display CloseButton
In this case, we can draw our customized button and call closeLayer function to perform the collapsing operation to the expanded layers.
Fig. 6 - Customized CloseButton