/plasma-tomography

A Deconvolutional Neural Network for Plasma Tomography

Primary LanguagePythonMIT LicenseMIT

A Deconvolutional Neural Network for Plasma Tomography

This repository contains a neural network that produces tomographic reconstructions similar to those available at JET.

Requirements

  • Python 3, TensorFlow 2.1, CUDA 10.1, cuDNN 7.6

Instructions

  1. Run python3 tomo_data.py to get all the available tomographic reconstructions and the corresponding bolometer signals.

    • This script will only run on a JET computing cluster (e.g. Freia).

    • An output file tomo_data.h5 will be created.

  2. Run python3 split_data.py to split the data into training set and validation set.

    • This will create two datasets: (X_train.npy, Y_train.npy) and (X_valid.npy, Y_valid.npy).
  3. Run python3 batch_size.py to determine the batch size that should be used during training.

    • Adjust n_gpus to reflect the number of GPUs to be used during training.
  4. Run python3 model_train.py to train the model.

    • Adjust batch_size according to the result of the previous script.

    • Training will finish automatically once the validation loss no longer improves.

    • The model will be saved in model.h5.

  5. After (or during) training, run python3 plot_train.py to plot the loss and validation loss across epochs.

    • The script will also indicate the epoch where the minimum validation loss was achieved.
  6. After training, run python3 model_valid.py to test the model on the validation set.

    • Check that the reported loss for the validation set is the same as indicated by plot_train.py.
  7. Run python3 bolo_data.py to collect the bolometer signals for a set or range of test pulses.

    • This script will only run on a JET computing cluster (e.g. Freia).

    • An output file bolo_data.h5 will be created.

  8. Run python3 model_predict.py to compute the full-pulse reconstructions for all test pulses.

    • The results will be appended to bolo_data.h5.
  9. Run python3 plot_frames.py 92213 48.0 54.0 0.01 1.0 to plot the reconstructions for a test pulse.

    • The command-line arguments specify the pulse, start time (t0), end time (t1), time step (dt) and dynamic range (vmax in MW/m3) for the plots.
  10. Run python3 plot_movie.py 92213 48.0 54.0 0.01 1.0 to produce a movie of the reconstructions for a test pulse.

    • The command-line arguments specify the pulse, start time (t0), end time (t1), time step (dt) and dynamic range (vmax in MW/m3) for the movie.

    • If needed, adjust fps to change the frame rate.

References