#NEWLINE# def loadData( ReqArgs , KwArgs , DataArgs , dataorderseed ) : #NEWLINE# #INDENT# ' Load DataObj specified by the user, using particular random seed.\n      Returns\n      --------\n      either \n        Data, InitData  \n      or\n        DataIterator, InitData\n\n      InitData must be a bnpy.data.DataObj object.\n      This DataObj is used for two early-stage steps in the training process\n        (a) Constructing observation model so that it has appropriate dimensions\n            For example, with 3D real data,\n            can only model the observations with a Gaussian over 3D vectors. \n        (b) Initializing global model parameters\n            Esp. in online settings, avoiding local optima might require using parameters\n            that are initialized from a much bigger dataset than each individual batch.\n      For most full dataset learning scenarios, InitData can be the same as Data.\n  ' #NEWLINE# sys . path . append ( os . environ [ 'BNPYDATADIR' ] ) #NEWLINE# datamod = __import__ ( ReqArgs [ 'dataName' ] , fromlist = [ ] ) #NEWLINE# algName = ReqArgs [ 'algName' ] #NEWLINE# if ( algName in FullDataAlgSet ) : #NEWLINE# #INDENT# Data = datamod . get_data ( ** DataArgs ) #NEWLINE# return ( Data , Data ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( algName in OnlineDataAlgSet ) : #NEWLINE# #INDENT# KwArgs [ algName ] [ 'nLap' ] = KwArgs [ 'OnlineDataPrefs' ] [ 'nLap' ] #NEWLINE# InitData = datamod . get_data ( ** DataArgs ) #NEWLINE# OnlineDataArgs = KwArgs [ 'OnlineDataPrefs' ] #NEWLINE# OnlineDataArgs [ 'dataorderseed' ] = dataorderseed #NEWLINE# OnlineDataArgs . update ( DataArgs ) #NEWLINE# DataIterator = datamod . get_minibatch_iterator ( ** OnlineDataArgs ) #NEWLINE# return ( DataIterator , InitData )