OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
MDN.model.utils Namespace Reference

Functions

def initialize_random_states (seed=None)
 
def ensure_format (arr)
 
def get_device (model_config)
 

Function Documentation

◆ ensure_format()

def MDN.model.utils.ensure_format (   arr)
Ensure passed array has two dimensions [n_sample, n_feature], and add the n_feature axis if not 

Definition at line 18 of file utils.py.

◆ get_device()

def MDN.model.utils.get_device (   model_config)
Return the tf.device a job should run on. Logic based
    on e.g. model size may be added in the future. 

Definition at line 24 of file utils.py.

◆ initialize_random_states()

def MDN.model.utils.initialize_random_states (   seed = None)
Initialize the numpy and tensorflow random states, setting the tensorflow global random state
    since most tensorflow methods don't yet pass around a random state appropriately. TF random 
    states might also not play nice with tf.functions:  
        https://www.tensorflow.org/api_docs/python/tf/random/set_global_generator 

Definition at line 5 of file utils.py.