reduce_funcs module
Full Documentation for hippynn.graphs.indextypes.reduce_funcs
module.
Click here for a summary page.
Functions for changing index states.
- db_state_of(idxt)[source]
Return the IdxType expected in the database for a given index type.
Note
This function is unlikely to be directed needed as a user. it’s more likely you want to use
db_form()
.
- dispatch_indexing(input_is, output_is)[source]
Acquire the function for converting between two index states.
- Parameters:
input_is – input index state
output_is – output index state
- Returns:
the function
- elementwise_compare_reduce(*nodes_to_reduce)[source]
Return nodes converted to a mutually compatible index state with no padding.
- Parameters:
nodes_to_reduce – nodes to put in a comparable, reduced index state
- Returns:
node (if single argument) or tuple(nodes) (if multiple arguments)
- get_reduced_index_state(*nodes_to_reduce)[source]
Find the index state for comparison between values in a loss function or plot.
Note
This function is unlikely to be directly needed as a user. it’s more likely you want to use
elementwise_compare_reduce()
.- Parameters:
nodes_to_reduce
- Returns:
- index_type_coercion(node, output_index_state)[source]
Attempt to convert a node to a given index state.
Note
If given a MultiNode, this function operates on the node’s main_output.
If there is no IdxType on the node, this function is a no-op, so that if one has not been implemented, no error will be raised.
If the index type already matches, then this function just returns the input node.
If the index type doesn’t match, an index transformer of the appropriate type will be looked for. If no conversion is found, a ValueError is raised.
- Parameters:
node – the node to convert
output_index_state – the index state to convert to.
- Returns:
a node in the requested index state