qlib
qlib copied to clipboard
How to adapt LSTM to DDG-DA
I want to adapt LSTM to DDG-DA, how can I do that?
What I have tried:
- modify rolling_benchmark.py to fit with LSTM parameters
- modify the bug caused by changing the dataset object to TSDatasetH. change the file in qlib > contrib > meta > data_selection > model.py:
def reweight(self, data: Union[pd.DataFrame, pd.Series]):
# TODO: handling TSDataSampler
if isinstance(data, pd.DataFrame):
idx = data.index
else:
idx = data.get_index()
w_s = pd.Series(1.0, index=idx)
for k, w in self.time_weight.items():
w_s.loc[slice(*k)] = w
logger.info(f"Reweighting result: {w_s}")
return w_s
However, the valid loss remains the same in different epoch and I don't know why.
@Xxiaoting Do the data weights change here?
You can set a breakpoint here to debug.
This issue is stale because it has been open for three months with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days