Training sets¶
ecopann.cosmic_params¶
-
class
ecopann.cosmic_params.ParamsProperty(param_names, params_dict=None)[source]¶ -
labels¶
-
param_fullNames¶
-
params_limit¶
-
-
ecopann.cosmic_params.params_dict_zoo()[source]¶ Information of cosmological parameters that include the labels and physical limits: [label, limit_min, limit_max]
The label is used to plot figures. The physical limits are used to ensure that the simulated parameters have physical meaning.
Note
If the physical limits of parameters is unknown or there is no physical limits, it should be set to np.nan.
ecopann.data_simulator¶
ecopann.data_processor¶
-
class
ecopann.data_processor.InverseNormalize(x1, statistic={}, norm_type='z_score', a=0, b=1)[source]¶ Bases:
objectInverse transformation of class
Normalize.
-
class
ecopann.data_processor.Normalize(x, statistic={}, norm_type='z_score', a=0, b=1)[source]¶ Bases:
objectNormalize data.
-
minmax()[source]¶ min-max normalization
Rescaling the range of features to scale the range in [0, 1] or [a,b] https://en.wikipedia.org/wiki/Feature_scaling
-
-
class
ecopann.data_processor.ParamsScaling(params_base)[source]¶ Bases:
objectData preprocessing of cosmological parameters.
Parameters: params_base (array-like) – A 1-D array that contains the base values of the cosmological parameters.
-
class
ecopann.data_processor.Statistic(x)[source]¶ Bases:
objectStatistics of an array.
-
mean¶
-
std¶
-
xmax¶
-
xmin¶
-
-
ecopann.data_processor.cpu2cuda(data)[source]¶ Transfer data from CPU to GPU.
Parameters: data (array-like or tensor) – Numpy array or torch tensor. Raises: TypeError– The data type should benp.ndarrayortorch.Tensor.Returns: Torch tensor. Return type: Tensor
-
ecopann.data_processor.cuda2numpy(data)[source]¶ Transfer data from the torch tensor (on GPU) to the numpy array (on CPU).
-
ecopann.data_processor.numpy2cuda(data, device=None)[source]¶ Transfer data from the numpy array (on CPU) to the torch tensor (on GPU).
-
ecopann.data_processor.numpy2torch(data)[source]¶ Transfer data from the numpy array (on CPU) to the torch tensor (on CPU).