def tt_graph(): global tt_graph_ if not tt_graph_: if not os.path.exists(tt_graph_fname): tic("creating empty tt graph", experiment_name) tt_graph_ = createTravelTimeGraph(hmm_graph(), radius=2e-4) tt_graph_.checkInvariants() save_ttg_structure(tt_graph_, experiment_name=experiment_name) else: tic("reading tt graph from %s"%tt_graph_fname, experiment_name) tt_graph_ = pickle.load(open(tt_graph_fname,'r')) return tt_graph_
# Complex model not implemented assert False tt_graph = createTravelTimeGraph(hmm_graph, radius=2e-4) tt_graph.checkInvariants() tt_graph_one_mode = createTravelTimeGraph(hmm_graph_one_mode, radius=2e-4) tt_graph_one_mode.checkInvariants() gmrf = emptyValues(tt_graph) gmrf_one_mode = emptyValues(tt_graph) # Checkpoint: save the structures save_ttg_structure(tt_graph, experiment_name=experiment_name) # The TTG structure is required when loading the GMRF (and the GMRF estimators) # Make sure they are saved in all the directories save_ttg_structure(tt_graph_one_mode, experiment_name='{0}_one_mode'.format(experiment_name)) save_ttg_structure(tt_graph_one_mode, experiment_name='{0}_one_mode_indep'.format(experiment_name)) save_ttg_structure(tt_graph, experiment_name='{0}_indep'.format(experiment_name)) # Loading the learning data data_source = experiment_design['data_source'] dates = data_source['dates'] basic_geometry = experiment_design['basic_geometry'] tspots_seqs = [ttob_seq for date in dates for ttob_seq in getDayTSpots(date,net)] traj_obs = [traj_ob for tspots_seq in tspots_seqs