API reference

Mapse.LinearPkEmulatorType
LinearPkEmulator(TrainedEmulator::AbstractTrainedEmulators, kgrid::Array, zgrid::Array,
InMinMax::Matrix, OutMinMax::Matrix)

This is the fundamental struct used to obtain the $C_\ell$'s from an emulator. It contains:

  • TrainedEmulator::AbstractTrainedEmulators, the trained emulator

  • kgrid::AbstractVector, the $k$-grid the emulator has been trained on.

  • zgrid::AbstractVector, the $z$-grid the emulator has been trained on.

  • InMinMax::AbstractMatrix, the Matrix used for the MinMax normalization of the input features

  • OutMinMax::AbstractMatrix, the Matrix used for the MinMax normalization of the output features

  • Postprocessing::Function, the Function used for the postprocessing of the NN output

source
Mapse.get_PkFunction
getPk(input_params, Pkemu::LinearPkEmulator)

Computes and returns the linear power spectrum on the $k-z$ grid the emulator has been trained on, given input array input_params.

source
Mapse.get_kgridFunction
get_kgrid(PkEmulator::AbstractCℓEmulators)

Returns the $k$-grid the emulator has been trained on.

source
Mapse.get_zgridFunction
get_zgrid(PkEmulator::AbstractPkEmulators)

Returns the $z$-grid the emulator has been trained on.

source
Mapse.load_emulatorFunction
load_emulator(path::String, emu_backend::AbstractTrainedEmulators)

Load the emulator with the files in the folder path, using the backend defined by emu_backend. The following keyword arguments are used to specify the name of the files used to load the emulator:

  • k_file, default k.npy
  • z_file, default z.npy
  • weights_file, default weights.npy
  • inminmax_file, default inminmax.npy
  • outminmax_file, default outminmax.npy
  • nn_setup_file, default nn_setup.json
  • postprocessing_file, default postprocessing.jl

If the corresponding file in the folder you are trying to load have different names, change the default values accordingly.

source