TCN(Temporal Convolutional Network)
Description
This API calls the TCN model, which can be used for anomaly detection, classification, time series prediction, and forecasting.
TCN Model Architecture

Based on 1D convolutional neural networks and is tailored to capture temporal dependencies effectively.
Key Features of TCN:
- Causal Convolutions
- Ensures that the predictions at time ๐ก depend only on inputs from time
๐ก and earlier, preserving the temporal order.
- Ensures that the predictions at time ๐ก depend only on inputs from time
- Dilated Convolutions
- Introduces gaps between filter elements to expand the receptive field without increasing the number of parameters.
- Allows the model to capture long-range temporal dependencies efficiently.
- Residual Connections
- Adds residual connections between layers, improving training stability and enabling deeper architectures.
- Flexible Receptive Field
- The size of the receptive field can be adjusted by modifying the kernel size, the number of layers, and the dilation factor.
- Parallel Computation
- Unlike RNNs, TCNs process sequences in parallel, making them faster and more efficient for training and inference.
API module path
from api.v2.model.TCN import TCN
Parameters
input_channels
- Specifies the length of the input channel.
- Example
- If data's shape (x,10,x).
- input_channels = 10
output_channels
- Specifies the length of the output channel.
- The channel of the model's output.
- Example
- If data's shape (x,1,x).
- output_channels = 1
hidden_channels
- Specifies the hidden channel.
- This value sets the number of nodes in the intermediate layer.
- Example
- This value is typically set list.
- hidden_channels = [25, 50, 75, 100]
kernel_size
- Specifies the kernel size.
- default : 2
- Example
- kernel_size = 3
dropout
- Specifies the dropout rate of layers.
- default : 0.2
- Example
- dropout = 0.2
Example Sample Code (Python)
Results

Check the entire module code.
datahub/api/v2/model/TCN.py at main ยท machbase/datahub
All Industrial IoT DataHub with data visualization and AI source - machbase/datahub