MCPcopy
hub / github.com/ZhengyaoJiang/PGPortfolio / get_last_rpv

Method get_last_rpv

pgportfolio/tdagent/tdagent.py:33–42  ·  view source on GitHub ↗

remove dimension of input. Return last relative price vector. :param x: matrix with shape (1, window_size, coin_number+1)

(self, x)

Source from the content-addressed store, hash-verified

31 raise NotImplementedError('subclass must implement this!')
32
33 def get_last_rpv(self, x):
34 '''remove dimension of input. Return last relative price vector.
35 :param x: matrix with shape (1, window_size, coin_number+1)
36 '''
37 if x.ndim == 3:
38 #print x.shape
39 last_rpv = x[0,:,-1] # output a vector with shape (x.size,)
40 else:
41 last_rpv = x #if it has already been processed just return x
42 return last_rpv
43
44 def get_first_history(self, x):
45 '''get history in first period

Callers 11

record_historyMethod · 0.95
decide_by_historyMethod · 0.80
decide_by_historyMethod · 0.80
decide_by_historyMethod · 0.80
decide_by_historyMethod · 0.80
decide_by_historyMethod · 0.80
decide_by_historyMethod · 0.80
decide_by_historyMethod · 0.80
decide_by_historyMethod · 0.80
decide_by_historyMethod · 0.80
decide_by_historyMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected