deepsphere.utils package

Submodules

deepsphere.utils.initialization module

deepsphere.utils.laplacian_funcs module

deepsphere.utils.parser module

Command Line Parser realated functions. One function creates the parser. Another function allows hybird usage of: - a yaml file with predefined parameters and - user inputted parameters through the command line.

deepsphere.utils.parser.create_parser()[source]

Creates a parser with all the variables that can be edited by the user.

Returns

a parser for the command line

Return type

parser

deepsphere.utils.parser.parse_config(parser)[source]

Takes the yaml file given through the command line Adds all the yaml file parameters, unless they have already been defined in the command line. Checks all values have been set else raises a Value error. :param parser: parser to be updated by the yaml file parameters :type parser: argparse.parser

Raises

ValueError – All fields must be set in the yaml config file or in the command line. Raises error if value is None (was not set).

Returns

parsed args of the parser

Return type

dict

deepsphere.utils.samplings module

Different samplings require various calculations. The calculations present here are for equiangular, healpix, icosahedron samplings.

deepsphere.utils.samplings.equiangular_bandwidth(nodes)[source]

Calculate the equiangular bandwidth based on input nodes

Parameters

nodes (int) – the number of nodes should be a power of 4

Returns

the corresponding bandwidth

Return type

int

deepsphere.utils.samplings.equiangular_calculator(tensor, ratio)[source]

From a 3D input tensor and a known ratio between the latitude dimension and longitude dimension of the data, reformat the 3D input into a 4D output while also obtaining the bandwidth.

Parameters
  • tensor (torch.tensor) – 3D input tensor

  • ratio (float) – the ratio between the latitude and longitude dimension of the data

Returns

4D tensor, the bandwidths for lat. and long.

Return type

torch.tensor, int, int

deepsphere.utils.samplings.equiangular_dimension_unpack(nodes, ratio)[source]

Calculate the two underlying dimensions from the total number of nodes

Parameters
  • nodes (int) – combined dimensions

  • ratio (float) – ratio between the two dimensions

Returns

separated dimensions

Return type

int, int

deepsphere.utils.samplings.healpix_resolution_calculator(nodes)[source]

Calculate the resolution of a healpix graph for a given number of nodes.

Parameters

nodes (int) – number of nodes in healpix sampling

Returns

resolution for the matching healpix graph

Return type

int

deepsphere.utils.samplings.icosahedron_nodes_calculator(order)[source]

Calculate the number of nodes corresponding to the order of an icosahedron graph

Parameters

order (int) – order of an icosahedron graph

Returns

number of nodes in icosahedron sampling for that order

Return type

int

deepsphere.utils.samplings.icosahedron_order_calculator(nodes)[source]

Calculate the order of a icosahedron graph for a given number of nodes.

Parameters

nodes (int) – number of nodes in icosahedron sampling

Returns

order for the matching icosahedron graph

Return type

int

deepsphere.utils.stats_extractor module

Module contents