|
|
|
This script provides a solution for training a neural network (NN) model utilizing DAQ data. Users can supply essential parameters related to the SASE, run name, properties, source, and label through command line options or interactive prompts. The script manages loading data, preparing features and targets, splitting datasets, normalizing data, instantiating the NN model, configuring optimization settings, performing early stopping, and saving finalized models alongside evaluation metrics.
|
|
|
|
|
|
|
|
### Key Functions
|
|
|
|
|
|
|
|
* `input_params(argv)`: Parses command line arguments and handles missing mandatory fields gracefully.
|
|
|
|
* `rmse(predictions, targets)`: Computes Root Mean Square Error between predicted and ground truth values.
|
|
|
|
* `train_model(model, epoch, train_loader, OPTIMIZER)`: Executes one epoch of training, updating the model weights and returning losses, scores, and updated model.
|
|
|
|
* `validation_model(model, valid_loader)`: Validates performance of the supplied NN model against a held-out dataset.
|
|
|
|
* `read_folder(data_folder)`: Concatenates Parquet formatted DAQ data frames contained within a particular folder.
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
Users should execute the script from the User-Interface by clicking on the Model tab, choosing a folder from the DAQ data section and clicking 'Train Model'. Otherwise, one should run the following command providing requisite CLI options;
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$
|
|
|
|
python3 NN_train_dxmaf.py --SASE $SASE --run_name $date --properties "models/$SASE/" --source "daq/runs/$SASE/" --label "$SASE-$date"
|
|
|
|
|
|
|
|
```
|
|
|
|
The launch_model_training.sh script shows an example of this usage. |