kesma

config.yaml

Jan 10th, 2025 (edited)
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.07 KB | Source Code | 0 0
  1. # =============================================================================
  2. # Configuration File for Training the Transformer Model
  3. #
  4. # You can rename config parameters, add or remove sections as you wish.
  5. # The script will read these fields by their keys.
  6. #
  7. # NOTE: YAML requires correct indentation. Comments are prefixed by '#'.
  8. # =============================================================================
  9.  
  10. paths:
  11.  # input_csv: Path to your CSV file containing data.
  12.   #            This can be changed for different CSVs to retrain on new data.
  13.   #
  14.   input_csv: "falls_detected.csv"
  15.   # input_csv: "fallD_batt_empty.csv"
  16.   # output_plots_dir: Directory to save any output plots (optional usage).
  17.   #                   If you do not wish to save plots, you can ignore or remove it.
  18.   output_plots_dir: "plots"
  19.  
  20. columns:
  21.  # date_col: Name of the date/time column used to parse dates (must exist in your CSV).
  22.   date_col: "Date"
  23.  
  24.   # target_col: The column name in your CSV that you want to forecast.
  25.   # target_col: "Battery_Empty"
  26.   target_col: "Falls"
  27.   # feature_cols: The list of column names (as they appear in CSV) to be used as features.
  28.   #               You can include the target_col itself here if you also use it as an input feature.
  29.   #               This script automatically adds day-of-week features, but you can rename or remove them if needed.
  30.   feature_cols:
  31.     - "Falls"
  32.     #- "Battery_Empty"
  33.     - "dow_sin"
  34.     - "dow_cos"
  35.     - "is_weekend"
  36.  
  37. training:
  38.  # window_size: Number of past time steps to include in a single input sequence for the model.
  39.   #              A larger window_size can help the model see more history (but can also increase training complexity).
  40.   window_size: 30
  41.  
  42.   # train_split: Fraction of data used for training (remainder is for validation/testing).
  43.   #              e.g. 0.8 means 80% training, 20% testing.
  44.   train_split: 0.8
  45.  
  46.   # epochs: Number of epochs (full passes through the training data).
  47.   #         Higher epochs can improve results but risk overfitting if too large.
  48.   epochs: 20
  49.  
  50.   # batch_size: Number of samples per gradient update.
  51.   #             Smaller batches can lead to more fine-grained updates, but slower training.
  52.   batch_size: 16
  53.  
  54.   # learning_rate: The step size for the optimizer when updating weights.
  55.   #                Too large => might not converge, too small => slow training.
  56.   learning_rate: 0.000001
  57.  
  58.   # 26, 16 for falls detected, good predictions
  59.   # learning_rate: 0.000001
  60.  
  61.  
  62. transformer:
  63.  # d_model: Dimensionality for the Transformer encoding space.
  64.   #          Must be large enough to capture information from your input features.
  65.   d_model: 32
  66.  
  67.   # num_heads: Number of attention heads in MultiHeadAttention.
  68.   #            More heads can capture more diverse relationships in time series, but also more computational cost.
  69.   num_heads: 8
  70.  
  71.   # ff_dim: Dimensionality of the feed-forward network within each Transformer block.
  72.   #         Typically larger than d_model to allow complex transformations.
  73.   ff_dim: 128
  74.  
  75.   # num_transformer_blocks: How many times to stack the Transformer encoder block.
  76.   #                         Deeper stacks => more representational power but can overfit if your dataset is small.
  77.   num_transformer_blocks: 4
  78.  
  79.   # dropout_rate: Dropout fraction in the attention and dense layers. Helps prevent overfitting.
  80.   #               Usually between 0.0 and 0.5 for typical deep learning tasks.
  81.   dropout_rate: 0.01
  82.  
  83.     #  EXAMPLES FOR smooth
  84.    
  85.     # d_model=32,
  86.     # num_heads=2,
  87.     # ff_dim=128,
  88.     # num_transformer_blocks=2,
  89.     # dropout_rate=0.01
  90.    
  91.     #  EXAMPLES FOR FALLS DETECTED 1 GREAT
  92.     # EPOCH 20,16
  93.     # d_model=32
  94.     # num_heads=2, also 8
  95.     # ff_dim=128,
  96.     # num_transformer_blocks=2, also 4
  97.     # dropout_rate=0.02
  98.    
  99.     #  WORKS FOR FALLS DETECTED
  100.     # 30 epoch with 16 size
  101.     # d_model=128,
  102.     # num_heads=4,
  103.     # ff_dim=512,
  104.     # num_transformer_blocks=4,
  105.     # dropout_rate=0.01
  106.  
  107. forecast:
  108.  # n_future: How many future time steps to forecast iteratively.
  109.   n_future: 15
  110.  
Advertisement
Add Comment
Please, Sign In to add comment