diff --git a/examples/benchmarks/HATS/README.md b/examples/benchmarks/HATS/README.md new file mode 100644 index 000000000..95619e1ee --- /dev/null +++ b/examples/benchmarks/HATS/README.md @@ -0,0 +1,15 @@ +##Requirement + +* pandas==1.1.2 +* numpy==1.17.4 +* scikit_learn==0.23.2 +* torch==1.7.0 + +##HATS + +* HATS is a a hierarchical attention network for stock prediction which uses relational data for stock market prediction. HATS selectively aggregates information +on different relation types and adds the information to the representations of each company. HATS is used as a relational modeling module with initialized node representations.Furthermore, HATS +can predict not only individual stock prices but also market index movements, which is similar to the graph classification task. + +* HATS uses pretrained model of GRU and LSTM. The code of GRU and LSTM used in Qlib is a pyTorch implemention of GRU and LSTM. +* Paper address:HATS: A Hierarchical Graph Attention Network for Stock Movement Prediction https://arxiv.org/pdf/1908.07999.pdf \ No newline at end of file diff --git a/qlib/contrib/model/pytorch_hats.py b/qlib/contrib/model/pytorch_hats.py index 7b4307e25..593cef635 100644 --- a/qlib/contrib/model/pytorch_hats.py +++ b/qlib/contrib/model/pytorch_hats.py @@ -1,5 +1,14 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from __future__ import division