()
A helper function that loads previously saved parameters and resets
    iteration start.
A helper function that loads previously saved parameters and resets
    iteration start.
A helper function that loads previously saved parameters and resets iteration start .
def load_saved_params():
    """
    A helper function that loads previously saved parameters and resets
    iteration start.
    """
    st = 0
    for f in glob.glob("saved_params_*.npy"):
        iter = int(op.splitext(op.basename(f))[0].split("_")[2])
        if (iter > st):
            st = iter

    if st > 0:
        params_file = "saved_params_%d.npy" % st
        state_file = "saved_state_%d.pickle" % st
        params = np.load(params_file)
        with open(state_file, "rb") as f:
            state = pickle.load(f)
        return st, params, state
    else:
        return st, None, None
def load_saved_params ( ) : st = 0 for f in glob . glob ( "saved_params_*.npy" ) : iter = int ( op . splitext ( op . basename ( f ) ) [ 0 ] . split ( "_" ) [ 2 ] ) if ( iter > st ) : st = iter if st > 0 : params_file = "saved_params_%d.npy" % st state_file = "saved_state_%d.pickle" % st params = np . load ( params_file ) with open ( state_file , "rb" ) as f : state = pickle . load ( f ) return st , params , state else : return st , None , None