ADAM Control Module

This is the primary control module for the ADAM algorithm, all other modules/functions are called from this control module.

ADAM.ADAM_control_Module.ADAM_update_parameter_df(pdef, parameter_df, obj_derivative_df, step)[source]

Performs the ADAM update on the optimization parameters.

The parameter_df variable is a panda DataFrame that holds all of the ADAM variables, that is: theta : optimization parameters mt : first moment vt : second moment Each of the above ADAM variables is housed in a vector with respect to each pixel. Often it is the case that a single pixel will have multiple optimization parameters applied to different materials within it. In such a case, the ADAM variables become indexed vectors where the index in the data frame indicates which material that parameter will be applied to and the location in the vector indicates the geometric location of that pixel.

Parameters
  • pdef (_type_) – _description_

  • obj_derivative_df (_type_) – _description_

  • step (_type_) – _description_

Returns

_description_

Return type

_type_

Raises

ValueError – _description_

ADAM.ADAM_control_Module.Create_New_Input(pixel_array, parameter_df, pdef, step)[source]

Creates a new MC Transport run file.

The purpose of this function is to take the parameters being optimized by ADAM and convert them into an input file for the user’s MC transport/sensitivity analysis of choice. This function follows the following steps: 1. Use transformation function defined in problem definition to convert the optimization parameters to density factors. 2. Apply density factors to the base material definitions for each pixel in the pixel array. 3. Create a MC Transport/sensitivity input file and fill the material definition with that of each pixel.

Parameters
  • pixel_array (object array) – Array of pixel objects describing the problem geometry.

  • parameter_df (DataFrame) – Contains all ADAM parameters, theta, mt, vt

  • pdef (object) – User defined problem definition object.

  • step (int) – Step of the Gradient descent algorithm currently being executed.

ADAM.ADAM_control_Module.run(step, pixel_array, pdef, output_filepath)[source]

This is the primary control function for the ADAM algorithm.

The parameter_df variable is defined from the previous step (or from the problem definition if on step 1). Then that sensitivities are read from the MC transport/sensitivity calculation and converted to derivatives with respect to the optimization parameters. The ADAM update is performed and the new parameters are saved. Finally, a new set of MC transport/sensitivity input files is created.

Parameters
  • step (int) – Step of the Gradient descent algorithm currently being executed.

  • pixel_array (object array) – Array of pixel objects describing the problem geometry.

  • pdef (object) – User defined problem definition object.