Open richarnaik opened 4 years ago
Sorry, can't get the entire code block to be formatted correctly. Hope it's still readable.
Hi!
Can you tell me what the shapes of tt
, TT
, Cnf
, and dCf
are? My first inclination is that something is shaped wrong so that some unintended broadcasting is happening somewhere.
The dataset fed into the GP should have inputs of shape (N,DX)
(and DX=1 here since the independent varaible is just t
) and outputs of shape (N,1)
.
Barring some mistake there, the next thing I'd check is whether the same issue happens with a subset of the data. The examples don't usually try to use that many data with a GP function model, which might be the problem, though I'm not convinced...needing hundreds of GBs of memory just sounds like the wrong order of magnitude.
One other comment: since your data is 1D, gradients and divergences are both simply scalar derivatives i.e. "d/dt", so using pirate.operator.Gradient
and pirate.operator.Divergence
shouldn't be strictly necessary instead of pirate.operator.ScalarGradient
.
@richarnaik any update? Let me know if you found a fix.
I ran PIRATE with a simulated dataset, and the process as killed, because of running out of memory. Here are screenshots of the terminal:
My code looks like this:
`
function for making experiments
def make_experiments( dataset): x = dataset["t"].values funcs = {} for col in ["C","T","dCdt"]: y = dataset[col].values gp = GP(x[:, np.newaxis], y[:, np.newaxis]) gp.train(num_epochs=1, learning_rate=0.1) gp.predict_mode()
def main(testing=False): args = parse_args_non_adaptive(testing) if not args.no_write: result_file = os.path.join( os.path.dirname(file), "..", "output", "exdata", "results", "n%is%i.txt" % (args.n_train, args.seed), ) result_dir = os.path.dirname(result_file) if not os.path.isdir(result_dir): os.makedirs(result_dir) if os.path.isfile(result_file) and not args.overwrite: print("Already found %s; exit." % result_file) exit()
if name == "main": main() `