Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =============================================================================
- # Configuration File for Training the Transformer Model
- #
- # You can rename config parameters, add or remove sections as you wish.
- # The script will read these fields by their keys.
- #
- # NOTE: YAML requires correct indentation. Comments are prefixed by '#'.
- # =============================================================================
- paths:
- # input_csv: Path to your CSV file containing data.
- # This can be changed for different CSVs to retrain on new data.
- #
- input_csv: "falls_detected.csv"
- # input_csv: "fallD_batt_empty.csv"
- # output_plots_dir: Directory to save any output plots (optional usage).
- # If you do not wish to save plots, you can ignore or remove it.
- output_plots_dir: "plots"
- columns:
- # date_col: Name of the date/time column used to parse dates (must exist in your CSV).
- date_col: "Date"
- # target_col: The column name in your CSV that you want to forecast.
- # target_col: "Battery_Empty"
- target_col: "Falls"
- # feature_cols: The list of column names (as they appear in CSV) to be used as features.
- # You can include the target_col itself here if you also use it as an input feature.
- # This script automatically adds day-of-week features, but you can rename or remove them if needed.
- feature_cols:
- - "Falls"
- #- "Battery_Empty"
- - "dow_sin"
- - "dow_cos"
- - "is_weekend"
- training:
- # window_size: Number of past time steps to include in a single input sequence for the model.
- # A larger window_size can help the model see more history (but can also increase training complexity).
- window_size: 30
- # train_split: Fraction of data used for training (remainder is for validation/testing).
- # e.g. 0.8 means 80% training, 20% testing.
- train_split: 0.8
- # epochs: Number of epochs (full passes through the training data).
- # Higher epochs can improve results but risk overfitting if too large.
- epochs: 20
- # batch_size: Number of samples per gradient update.
- # Smaller batches can lead to more fine-grained updates, but slower training.
- batch_size: 16
- # learning_rate: The step size for the optimizer when updating weights.
- # Too large => might not converge, too small => slow training.
- learning_rate: 0.000001
- # 26, 16 for falls detected, good predictions
- # learning_rate: 0.000001
- transformer:
- # d_model: Dimensionality for the Transformer encoding space.
- # Must be large enough to capture information from your input features.
- d_model: 32
- # num_heads: Number of attention heads in MultiHeadAttention.
- # More heads can capture more diverse relationships in time series, but also more computational cost.
- num_heads: 8
- # ff_dim: Dimensionality of the feed-forward network within each Transformer block.
- # Typically larger than d_model to allow complex transformations.
- ff_dim: 128
- # num_transformer_blocks: How many times to stack the Transformer encoder block.
- # Deeper stacks => more representational power but can overfit if your dataset is small.
- num_transformer_blocks: 4
- # dropout_rate: Dropout fraction in the attention and dense layers. Helps prevent overfitting.
- # Usually between 0.0 and 0.5 for typical deep learning tasks.
- dropout_rate: 0.01
- # EXAMPLES FOR smooth
- # d_model=32,
- # num_heads=2,
- # ff_dim=128,
- # num_transformer_blocks=2,
- # dropout_rate=0.01
- # EXAMPLES FOR FALLS DETECTED 1 GREAT
- # EPOCH 20,16
- # d_model=32
- # num_heads=2, also 8
- # ff_dim=128,
- # num_transformer_blocks=2, also 4
- # dropout_rate=0.02
- # WORKS FOR FALLS DETECTED
- # 30 epoch with 16 size
- # d_model=128,
- # num_heads=4,
- # ff_dim=512,
- # num_transformer_blocks=4,
- # dropout_rate=0.01
- forecast:
- # n_future: How many future time steps to forecast iteratively.
- n_future: 15
Advertisement
Add Comment
Please, Sign In to add comment