MCPcopy Create free account

hub / github.com/AI4QTrading/R2-SAC / functions

Functions73 in github.com/AI4QTrading/R2-SAC

↓ 15 callersMethodappend
add an experience sample at the end of replay memory Args: obs (float32): observation, shape of obs_dim act (int32 i
replay_memory_sacduiqi.py:92
↓ 10 callersMethodto_tensor
(data)
stock_dataset_havkes_zz1000.py:193
↓ 6 callersMethodseed
(self, seed)
StockEnv_zz1000.py:42
↓ 6 callersMethodsize
get current size of replay memory.
replay_memory_sacduiqi.py:112
↓ 3 callersMethod__init__
(self, input_size, output_size, num_channels, kernel_size, dropout)
model.py:79
↓ 3 callersMethodsave
save replay memory to local file (numpy file format: *.npz).
replay_memory_sacduiqi.py:120
↓ 2 callersMethod__init__
(self, in_c, hid_c, out_c, n_heads)
gat.py:72
↓ 2 callersMethod__init__
(self, state_dim, action_dim)
StockModel.py:33
↓ 2 callersMethod_next_observation
(self)
StockEnv_zz1000.py:49
↓ 2 callersMethodload
load replay memory from local file (numpy file format: *.npz).
replay_memory_sacduiqi.py:133
↓ 2 callersFunctionprocess
(data,bs)
TCN_GAT_zz1000.py:39
↓ 2 callersMethodrecover_data
:param max_data: np.array, max data. :param min_data: np.array, min data. :param data: np.array, normalized data. :re
stock_dataset_havkes_zz1000.py:174
↓ 2 callersFunctionsplit_windows
(data,labely,size)
TCN_GAT_zz1000.py:30
↓ 2 callersMethodstep
(self, action)
StockEnv_zz1000.py:137
↓ 1 callersMethod_take_action
(self, action)
StockEnv_zz1000.py:79
↓ 1 callersFunctiondo_train
(agent,env,rpm)
SAC_zz1000.py:73
↓ 1 callersFunctionfind_data_root
Find the root "data" directory within this repository. Returns: str: absolute path of the "data" directory within this repository
util.py:73
↓ 1 callersFunctionfind_repo_root
Find the root path of this repository. Returns: str: absolute path of the root of this repository
util.py:63
↓ 1 callersFunctionget_adjacent_matrix
:param distance_file: str, path of csv file to save the distances between nodes. :param num_nodes: int, number of nodes in the graph :par
stock_dataset_havkes_zz1000.py:8
↓ 1 callersFunctionget_flow_data
:param flow_file: str, path of .npz file to save the traffic flow data :return: np.array(N, T, D)
stock_dataset_havkes_zz1000.py:27
↓ 1 callersMethodlearn
(self,obs,action,reward,next_obs,terminal)
StockAgent.py:27
↓ 1 callersMethodmae_
(target, output)
utils.py:13
↓ 1 callersFunctionmain
(a,b)
TCN_GAT_zz1000.py:53
↓ 1 callersFunctionmakedirs
Create a directory (and its parents) if it does not exist. Args: path (str): directory path to create, including any missing parents
util.py:47
↓ 1 callersMethodmape_
(target, output)
utils.py:17
↓ 1 callersFunctionnavigate_parent_dirs
Navigate to a parent directory relative to a given file path. Args: path (str): path to navigate from (file or directory; note that
util.py:21
↓ 1 callersMethodnormalize_base
:param data: np.array, 原始的交通流量数据 :param norm_dim: int, normalization dimension.归一化的维度,就是说在哪个维度上归一化,这里是在dim=1时间维度上 :return:
stock_dataset_havkes_zz1000.py:145
↓ 1 callersMethodnormalize_data
:param max_data: np.array, max data. :param min_data: np.array, min data. :param data: np.array, original traffic data withou
stock_dataset_havkes_zz1000.py:159
↓ 1 callersMethodpre_process_data
:param data: np.array,原始的交通流量数据 :param norm_dim: int,归一化的维度,就是说在哪个维度上归一化,这里是在dim=1时间维度上 :return: norm_base: list,
stock_dataset_havkes_zz1000.py:131
↓ 1 callersMethodreset
(self, new_df=None)
StockEnv_zz1000.py:194
↓ 1 callersMethodrmse_
(target, output)
utils.py:21
↓ 1 callersFunctionrun_train_episode
(agent,env,rpm,episode_num)
SAC_zz1000.py:31
↓ 1 callersMethodsample
(self,obs)
StockAgent.py:19
↓ 1 callersMethodsample_batch
sample a batch from replay memory Args: batch_size (int): batch size Returns: a batch of experience samples
replay_memory_sacduiqi.py:46
↓ 1 callersMethodslice_data
:param data: np.array, normalized traffic data. :param history_length: int, length of history data to be used. :param index:
stock_dataset_havkes_zz1000.py:106
↓ 1 callersMethodtotal
(target, output)
utils.py:25
Method__getitem__
:param index: int, range between [0, length - 1]. :return: graph: torch.tensor, [N, N]. data_x: torch.tensor,
stock_dataset_havkes_zz1000.py:83
Method__init__
(self, in_c, out_c)
gat.py:10
Method__init__
(self, in_c, hid_c, out_c, n_heads)
gat.py:43
Method__init__
:param data_path: list, ["graph file name" , "flow data file name"], path to save the data file names. :param num_nodes: int, number
stock_dataset_havkes_zz1000.py:48
Method__init__
(self)
utils.py:9
Method__init__
(self, df)
StockEnv_zz1000.py:19
Method__init__
create a replay memory for off-policy RL or offline RL. Args: max_size (int): max size of replay memory obs_dim (lis
replay_memory_sacduiqi.py:22
Method__init__
(self,algorithm)
StockAgent.py:7
Method__init__
(self,obs_dim,action_dim)
StockModel.py:12
Method__init__
(self, obs_dim, action_dim)
StockModel.py:71
Method__init__
(self, crop_size)
model.py:8
Method__init__
(self, n_inputs, n_outputs, kernel_size, stride, dilation, dropout=0.2)
model.py:18
Method__init__
(self, num_inputs, num_channels, kernel_size=2, dropout=0.2)
model.py:53
Method__len__
:return: length of dataset (number of samples).
stock_dataset_havkes_zz1000.py:72
Method__len__
(self)
replay_memory_sacduiqi.py:117
Methodadd_step
(self)
StockEnv_zz1000.py:45
Functioncompute_performance
(prediction, target, data)
TCN_GAT_zz1000.py:159
Functionfind_data_dir
Find a custom data directory within this repository, and optionally create it if it does not exist. For example, to resolve the absolute pat
util.py:83
Methodforward
:param inputs: input features, [B, N, C]. :param graph: graph structure, [N, N]. :return: output features, [B, N,
gat.py:23
Methodforward
:param inputs: [B, N, C] :param graph: [N, N] :return:
gat.py:56
Methodforward
(self, data, device)
gat.py:76
Methodforward
(self, obs)
StockModel.py:47
Methodforward
(self, obs, action)
StockModel.py:85
Methodforward
(self, x)
model.py:12
Methodforward
(self, x)
model.py:44
Methodforward
(self, x)
model.py:72
Methodforward
(self, x)
model.py:85
Methodget_actor_params
(self)
StockModel.py:23
Methodget_critic_params
(self)
StockModel.py:27
Methodload_from_d4rl
load data from d4rl dataset(https://github.com/rail-berkeley/d4rl#using-d4rl) to replay memory. Args: dataset(dict): dataset tha
replay_memory_sacduiqi.py:150
Methodmake_index
sample a batch of indexes Args: batch_size (int): batch size Returns: batch of indexes
replay_memory_sacduiqi.py:64
Methodpolicy
(self,obs)
StockModel.py:17
Methodpredict
(self,obs)
StockAgent.py:12
Methodrender
(self, mode='human')
StockEnv_zz1000.py:213
Methodsample_batch_by_index
sample a batch from replay memory by indexes Args: batch_idx (list or np.array): batch indexes Returns: a b
replay_memory_sacduiqi.py:76
Methodvalue
(self,obs,action)
StockModel.py:20
Functionvisualize_result
(h5_file, nodes_id, time_se, visualize_file)
utils.py:33