Shortcuts

tomopt.benchmarks.ladle_furnace package

Submodules

tomopt.benchmarks.ladle_furnace.data module

class tomopt.benchmarks.ladle_furnace.data.LadleFurnacePassiveGenerator(volume, x0_furnace=0.01782, fill_material='hot liquid steel', slag_material='slag')[source]

Bases: AbsPassiveGenerator

Research tested only: no unit tests

tomopt.benchmarks.ladle_furnace.inference module

class tomopt.benchmarks.ladle_furnace.inference.EdgeDetLadleFurnaceFillLevelInferrer(partial_x0_inferrer, volume, pipeline=['remove_ladle', 'avg_3d', 'avg_layers', 'avg_1d', 'ridge_1d_0', 'negative', 'max_div_min'], add_batch_dim=True, output_probs=True)[source]

Bases: AbsIntClassifierFromX0

Research tested only: no unit tests

static avg_1d(x)[source]
Return type:

Tensor

static avg_3d(x)[source]
Return type:

Tensor

static avg_layers(x)[source]
Return type:

Tensor

static edge_det(x, kernel)[source]
Return type:

Tensor

static gauss_1d(x)[source]
Return type:

Tensor

static gauss_3d(x)[source]
Return type:

Tensor

laplacian_1d(x)[source]
Return type:

Tensor

static max_div_min(x)[source]
Return type:

Tensor

static max_sub_min(x)[source]
Return type:

Tensor

static negative(x)[source]
Return type:

Tensor

prewit_1d(x)[source]
Return type:

Tensor

static remove_ladle(x)[source]

Assumes ladle is 1 voxel thick

Return type:

Tensor

ridge_1d_0(x)[source]
Return type:

Tensor

ridge_1d_2(x)[source]
Return type:

Tensor

ridge_1d_4(x)[source]
Return type:

Tensor

ridge_1d_8(x)[source]
Return type:

Tensor

x02probs(vox_preds)[source]

Inheriting classes must override this method to convert voxelwise X0 predictions to class probabilities

Parameters:

vox_preds (Tensor) – (z,x,y) tensor of voxelwise X0 predictions

Return type:

Tensor

Returns:

(*) tensor of class probabilities

class tomopt.benchmarks.ladle_furnace.inference.LinearCorrectionCallback(partial_opt, init_weight=1.0, init_bias=0.0)[source]

Bases: Callback

Research tested only: no unit tests

on_backwards_end()[source]

Runs when the loss for a batch of passive volumes has been backpropagated, but parameters have not yet been updated.

Return type:

None

on_train_begin()[source]

Runs when detector fitting begins.

Return type:

None

on_volume_batch_begin()[source]

Runs when a new batch of passive volume layouts is begins.

Return type:

None

on_x0_pred_end()[source]

Runs after the volume inferrer has made its final prediction, but before the loss is computed.

Return type:

None

class tomopt.benchmarks.ladle_furnace.inference.PocaZLadleFurnaceFillLevelInferrer(volume, smooth=0.1)[source]

Bases: AbsVolumeInferrer

Research tested only: no unit tests

Computes fill heigh based on weighted average of z of POCAs

compute_efficiency(scatters)[source]

Computes the per-muon efficiency, given the individual muon hit efficiencies, as the probability of at least two hits above and below the passive volume.

Parameters:

scatters (ScatterBatch) – scatter batch containing muons whose efficiency should be computed

Return type:

Tensor

Returns:

(muons) tensor of muon efficiencies

get_prediction()[source]

Computes the predicted fill level via a weighted average of POCA locations.

Returns:

fill-height prediction [m]

Return type:

pred

property muon_efficiency: Tensor

Returns: (muons,1) tensor of the efficiencies of the muons

property muon_poca_xyz: Tensor

Returns: (muons,xyz) tensor of PoCA locations

property muon_poca_xyz_unc: Tensor

Returns: (muons,xyz) tensor of PoCA location uncertainties

property n_mu: int

Returns: Total number muons included in the inference

property pred_height: Tensor

Returns: (h) tensor of fill-height prediction

property smooth: Tensor

tomopt.benchmarks.ladle_furnace.loss module

class tomopt.benchmarks.ladle_furnace.loss.LadleFurnaceIntClassLoss(*, pred_int_start=0, use_mse, target_budget, budget_smoothing=10, cost_coef=None, steep_budget=True, debug=False)[source]

Bases: VolumeIntClassLoss

Research tested only: no unit tests

class tomopt.benchmarks.ladle_furnace.loss.SpreadRangeLoss[source]

Bases: Callback

Research tested only: no unit tests

on_volume_batch_begin()[source]

Runs when a new batch of passive volume layouts is begins.

Return type:

None

on_volume_batch_end()[source]

Runs when a batch of passive volume layouts is ends.

Return type:

None

on_x0_pred_end()[source]

Runs after the volume inferrer has made its final prediction, but before the loss is computed.

Return type:

None

tomopt.benchmarks.ladle_furnace.plotting module

tomopt.benchmarks.ladle_furnace.plotting.compare_init_optimised_2(df_start, df_opt_2, NAME)[source]
Return type:

None

tomopt.benchmarks.ladle_furnace.plotting.compare_init_to_optimised(df_start, df_opt, NAME)[source]
Return type:

None

tomopt.benchmarks.ladle_furnace.plotting.compare_optimised_to_baselines(df_bl_1, df_bl_2, df_opt_2, NAME)[source]
Return type:

None

tomopt.benchmarks.ladle_furnace.plotting.compare_raw_init_to_bias_corrected_init(df_start, NAME)[source]
Return type:

None

tomopt.benchmarks.ladle_furnace.volume module

tomopt.benchmarks.ladle_furnace.volume.get_baseline_detector_1(*, res=10000.0, eff=0.9, span=0.8, device=device(type='cpu'))[source]
Return type:

ModuleList

tomopt.benchmarks.ladle_furnace.volume.get_baseline_detector_2(*, res=10000.0, eff=0.9, span=0.8, device=device(type='cpu'))[source]
Return type:

ModuleList

tomopt.benchmarks.ladle_furnace.volume.get_initial_detector(*, res=10000.0, eff=0.9, span=0.8, device=device(type='cpu'))[source]
Return type:

ModuleList

Docs

Access comprehensive developer and user documentation for TomOpt

View Docs

Tutorials

Get tutorials for beginner and advanced researchers demonstrating many of the features of TomOpt

View Tutorials