Skip to content

Commit 7ec0370

Browse files
authored
new representation docs (#225)
1 parent 53d9dfc commit 7ec0370

File tree

2 files changed

+106
-96
lines changed

2 files changed

+106
-96
lines changed

docs/locale/zh_CN/LC_MESSAGES/source/modules/models/representation.po

+68-68
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: \n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2022-11-01 15:19+0800\n"
11+
"POT-Creation-Date: 2022-11-03 19:00+0800\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,12 +18,12 @@ msgstr ""
1818
"Generated-By: Babel 2.10.3\n"
1919

2020
#: ../../source/modules/models/representation.rst:3
21-
#: 9b064944e0964bdbbb2915390845514f
21+
#: 2129e18757cd45339d97c4e5a75d789d
2222
msgid "Representation Model Tutorial"
2323
msgstr "表征模型使用教程"
2424

2525
#: ../../source/modules/models/representation.rst:5
26-
#: abd881ced8334a62ad29b17617645b05
26+
#: 5896660fa6c1416ba7b4f5776d48051f
2727
msgid ""
2828
"The representation model (TS2Vec) is one of the self-supervised models, "
2929
"mainly hoping to learn a general feature expression for downstream tasks."
@@ -33,155 +33,155 @@ msgid ""
3333
msgstr "表征模型(TS2Vec)属于自监督模型里的一种,主要是希望能够学习到一种通用的特征表达用于下游任务;当前主流的自监督学习主要有基于生成式和基于对比学习的方法,当前案例使用的TS2Vec模型是一种基于对比学习的自监督模型"
3434

3535
#: ../../source/modules/models/representation.rst:9
36-
#: 3025ac9aaf0446fc95a211d81437c9ce
36+
#: 09155f9a2ee447c7bb16e3599abba6b9
3737
msgid "The use of self-supervised models is divided into two phases:"
3838
msgstr "自监督模型的使用一般分为两个阶段"
3939

4040
#: ../../source/modules/models/representation.rst:8
41-
#: 771b57b7651b4109bb60e44ec04edb0b
41+
#: 79f6b680fde64c7a81536cfdf190cb88
4242
msgid "Pre-training with unlabeled data, independent of downstream tasks"
4343
msgstr "不涉及任何下游任务,使用无标签的数据进行预训练"
4444

4545
#: ../../source/modules/models/representation.rst:9
46-
#: 259b6005c1124e83a51050a77e625e80
46+
#: 49fb481f64bb4045809861500e6f6265
4747
msgid "Fine-tune on downstream tasks using labeled data"
4848
msgstr "使用带标签的数据在下游任务上 Fine-tune"
4949

5050
#: ../../source/modules/models/representation.rst:13
51-
#: c847d4c3b8aa47fb914da3ecec97be17
51+
#: 95ca2edf84d247038fa0547759e6c9cb
5252
msgid "TS2Vec follows the usage paradigm of self-supervised models:"
5353
msgstr "TS2Vec结合下游任务的使用同样遵循自监督模型的使用范式,分为2个阶段:"
5454

5555
#: ../../source/modules/models/representation.rst:12
56-
#: 36866eb1d84442109043c8f4f1b5e07f
56+
#: 765c6f6c9a05406eac590aa81eab9de3
5757
msgid "Representational model training"
5858
msgstr "表征模型训练"
5959

6060
#: ../../source/modules/models/representation.rst:13
61-
#: 71ec4f51da22462e8981f16fcca546a0
61+
#: fec2e8aa03ec49c4b19edb67a882af84
6262
msgid ""
6363
"Use the output of the representation model for the downstream task (the "
6464
"downstream task of the current case is the prediction task)"
6565
msgstr "将表征模型的输出用于下游任务(当前案例的下游任务为预测任务)"
6666

6767
#: ../../source/modules/models/representation.rst:17
68-
#: 550841919e924e2fb9e52fbd95245cd0
68+
#: 6d77625749df473f8ead84b68e0b31de
6969
msgid ""
7070
"For the sake of accommodating both beginners and experienced developers, "
7171
"there are two ways to use representation tasks:"
7272
msgstr "为兼顾初学者和有一定的经验的开发者,本文给出两种表征任务的使用方法:"
7373

7474
#: ../../source/modules/models/representation.rst:16
75-
#: dbd70c46672c464abdd8e66e49feaf92
75+
#: 42e63162d16042c29c6341bfbfa4b097
7676
msgid ""
7777
"A pipeline that combines the representation model and downstream tasks, "
7878
"which is very friendly to beginners"
7979
msgstr "表征模型和下游任务相结合的pipeline,初学者容易上手使用"
8080

8181
#: ../../source/modules/models/representation.rst:17
82-
#: 108a7dc6375249d48c832583ae037860
82+
#: c47fdd248d0d40a5b53b53401284fe94
8383
msgid ""
8484
"Decoupling the representational model and downstream tasks, showing in "
8585
"detail how the representational model and downstream tasks are used in "
8686
"combination"
8787
msgstr "表征模型和下游任务解耦,详细展示表征模型和下游任务如何相结合使用"
8888

8989
#: ../../source/modules/models/representation.rst:20
90-
#: 2d31625f0fdd48609b97bd524cb2e7a5
91-
msgid "Method one"
92-
msgstr "使用方法一"
90+
#: 7795706790b54c6cb6254116d2a288c0
91+
msgid "1. Method one"
92+
msgstr "1. 方法一"
9393

9494
#: ../../source/modules/models/representation.rst:22
95-
#: 18b9f26fe49b4f30b773d8fb3f34f639
95+
#: 8a8be0919e1f4431af5cb789ac8da2b3
9696
msgid "A pipeline that combines the representation model and downstream tasks"
9797
msgstr "表征模型和下游任务相结合的pipeline"
9898

9999
#: ../../source/modules/models/representation.rst:25
100-
#: 26e917470da34204b8a544ab27cd7341
101-
msgid "Prepare the data"
100+
#: b52cd7e6c4b740929c5cdffa4f1302c5
101+
msgid "1.1 Prepare the data"
102102
msgstr "准备数据集"
103103

104-
#: ../../source/modules/models/representation.rst:45
105-
#: b13f51b26893463ebc91a547a228ff75
106-
msgid "Training"
104+
#: ../../source/modules/models/representation.rst:44
105+
#: a91871d5d4a8494492c5dac6bab66299
106+
msgid "1.2 Training"
107107
msgstr "训练"
108108

109109
#: ../../source/modules/models/representation.rst:61
110-
#: bd7972f40530496b9e2ec804ff408312
111-
msgid "Prediction"
110+
#: 71db106f238e4055871114df13d66948
111+
msgid "1.3 Prediction"
112112
msgstr "预测"
113113

114-
#: ../../source/modules/models/representation.rst:67
115-
#: c343a6b1e1d640a08f30c310f93a9cff
116-
msgid "Backtest"
114+
#: ../../source/modules/models/representation.rst:68
115+
#: 520a95c9594449938c591ae52057a5bc
116+
msgid "1.4 Backtest"
117117
msgstr "回测"
118118

119-
#: ../../source/modules/models/representation.rst:81
120-
#: bd7175abbd8c45ea8088352499788ea4
121-
msgid "Method two"
122-
msgstr "使用方法二"
123-
124119
#: ../../source/modules/models/representation.rst:83
125-
#: e07ddc48cb9d4d28a6670b3b417f1084
120+
#: bc4059a9057b487e9617723ddd54b037
121+
msgid "2. Method two"
122+
msgstr "2. 方法二"
123+
124+
#: ../../source/modules/models/representation.rst:85
125+
#: 9f53fba5287d473abe61e9945e8f88e6
126126
msgid ""
127127
"Decoupling the representational model and downstream tasks. It's divided "
128128
"into two stages, the first stage is representation model training and "
129129
"prediction, and the second stage is the training and prediction of "
130130
"downstream tasks"
131-
msgstr "表征模型和下游回归任务解藕. 分为两个阶段,第一阶段是表征模型的训练和预测,第二阶段是下游任务模型的训练和预测"
131+
msgstr "表征模型和下游回归任务解耦. 分为两个阶段,第一阶段是表征模型的训练和预测,第二阶段是下游任务模型的训练和预测"
132132

133-
#: ../../source/modules/models/representation.rst:86
134-
#: bec3f1fdcff040eca38c6d9b92102ef0
135-
msgid "1. The first stage:"
133+
#: ../../source/modules/models/representation.rst:87
134+
#: da94ae067fa54515b66dfd73a0a426df
135+
msgid "The first stage:"
136136
msgstr "第一阶段:"
137137

138-
#: ../../source/modules/models/representation.rst:87
139-
#: 56576ed054584365b4e5985058b0b7c8
138+
#: ../../source/modules/models/representation.rst:89
139+
#: a5b0f8777bf64ba6bc19bcc51fb61a89
140140
msgid "Training of the representation model"
141141
msgstr "表征模型训练"
142142

143-
#: ../../source/modules/models/representation.rst:88
144-
#: 6fd9a537483d47a69fd323596fbbdf18
143+
#: ../../source/modules/models/representation.rst:90
144+
#: 47194a7a5d8d4b23bf90bbad849191be
145145
msgid "Output of training set and test set representation results"
146146
msgstr "输出训练集和测试集的表征结果"
147147

148148
#: ../../source/modules/models/representation.rst:92
149-
#: 230b62e6ade9443493cafb3b84f7374d
150-
msgid "1.1 Prepare the data"
151-
msgstr "准备数据集"
152-
153-
#: ../../source/modules/models/representation.rst:111
154-
#: f5c8ed59f85244b8934e9df6882b63a5
155-
msgid "1.2 Training of the representation model"
156-
msgstr "表征模型训练"
149+
#: 9b8d6802816b4626866c736827d7c88b
150+
msgid "The second stage:"
151+
msgstr "第二阶段:"
157152

158-
#: ../../source/modules/models/representation.rst:126
159-
#: 1f2ca0e0cae941f9a95091f2dfb1d196
160-
msgid "1.3 Output of training set and test set representation results"
161-
msgstr "输出训练集和测试集的表征结果"
162-
163-
#: ../../source/modules/models/representation.rst:136
164-
#: d194f7b4827741abb800c8f8fa463d1c
165-
msgid "2. The second stage:"
166-
msgstr "第二阶段"
167-
168-
#: ../../source/modules/models/representation.rst:137
169-
#: 725503101ee545309d47377830437ec8
153+
#: ../../source/modules/models/representation.rst:94
154+
#: 78d575ebea984274a3148c6c2dba837f
170155
msgid "Build training and test samples for regression models"
171156
msgstr "构建回归模型的训练和测试样本"
172157

173-
#: ../../source/modules/models/representation.rst:138
174-
#: 2d5a609b4f8545eb8f54c1c3e0bb5636
158+
#: ../../source/modules/models/representation.rst:95
159+
#: b973d5de54c64be8b5943c319aa34d75
175160
msgid "training and prediction"
176161
msgstr "训练和预测"
177162

178-
#: ../../source/modules/models/representation.rst:141
179-
#: 73afc3be00df4cc7941c7acf12e358be
180-
msgid "2.1 Build training and test samples for regression models"
163+
#: ../../source/modules/models/representation.rst:99
164+
#: d9201c888f4a4a14b3a2fc008322b158
165+
msgid "2.1 Prepare the data"
166+
msgstr "准备数据集"
167+
168+
#: ../../source/modules/models/representation.rst:117
169+
#: 262ab9ad28c24431956b37d12996ef0f
170+
msgid "2.2 Training of the representation model"
171+
msgstr "表征模型训练"
172+
173+
#: ../../source/modules/models/representation.rst:133
174+
#: 16eb6ad99a3848fdbe1bc734eecc2e0b
175+
msgid "2.3 Output of training set and test set representation results"
176+
msgstr "输出训练集和测试集的表征结果"
177+
178+
#: ../../source/modules/models/representation.rst:145
179+
#: 2a0b3a5f49c14282a3604b330715115b
180+
msgid "2.4 Build training and test samples for regression models"
181181
msgstr "构建回归模型的训练和测试样本"
182182

183-
#: ../../source/modules/models/representation.rst:167
184-
#: ed3d7f9d693d4fbba33ef4a5196ffe81
185-
msgid "2.2 Training and prediction"
183+
#: ../../source/modules/models/representation.rst:172
184+
#: ff0a0ac6b9c24b9caf5a1841744766eb
185+
msgid "2.5 Training and prediction"
186186
msgstr "训练和预测"
187187

docs/source/modules/models/representation.rst

+38-28
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ For the sake of accommodating both beginners and experienced developers, there a
1616
- A pipeline that combines the representation model and downstream tasks, which is very friendly to beginners
1717
- Decoupling the representational model and downstream tasks, showing in detail how the representational model and downstream tasks are used in combination
1818

19-
Method one
19+
1. Method one
2020
=================
2121

2222
A pipeline that combines the representation model and downstream tasks
2323

24-
Prepare the data
25-
================
24+
1.1 Prepare the data
25+
--------------------
26+
2627
.. code-block:: python
2728
2829
import numpy as np
@@ -39,8 +40,9 @@ Prepare the data
3940
data, _ = data.split('2016-09-22 06:00:00')
4041
train_data, test_data = data.split('2016-09-21 05:00:00')
4142
42-
Training
43-
========
43+
1.2 Training
44+
------------
45+
4446
.. code-block:: python
4547
4648
ts2vec_params = {"segment_size": 200,
@@ -55,14 +57,16 @@ Training
5557
repr_model_params=ts2vec_params)
5658
model.fit(train_data)
5759
58-
Prediction
59-
==========
60+
1.3 Prediction
61+
--------------
62+
6063
.. code-block:: python
6164
6265
model.predict(train_data)
6366
64-
Backtest
65-
========
67+
1.4 Backtest
68+
------------
69+
6670
.. code-block:: python
6771
6872
from paddlets.utils.backtest import backtest
@@ -75,19 +79,25 @@ Backtest
7579
return_predicts=True)
7680
7781
78-
Method two
82+
2. Method two
7983
=================
8084

8185
Decoupling the representational model and downstream tasks. It's divided into two stages, the first stage is representation model training and prediction, and the second stage is the training and prediction of downstream tasks
8286

83-
1. The first stage:
84-
===================
85-
- Training of the representation model
86-
- Output of training set and test set representation results
87+
The first stage:
8788

89+
- Training of the representation model
90+
- Output of training set and test set representation results
91+
92+
The second stage:
93+
94+
- Build training and test samples for regression models
95+
- training and prediction
96+
97+
98+
2.1 Prepare the data
99+
--------------------
88100

89-
1.1 Prepare the data
90-
====================
91101
.. code-block:: python
92102
93103
import numpy as np
@@ -103,8 +113,9 @@ Decoupling the representational model and downstream tasks. It's divided into tw
103113
data, _ = data.split('2016-09-22 06:00:00')
104114
train_data, test_data = data.split('2016-09-21 05:00:00')
105115
106-
1.2 Training of the representation model
107-
========================================
116+
2.2 Training of the representation model
117+
----------------------------------------
118+
108119
.. code-block:: python
109120
110121
# initialize the TS2Vect object
@@ -118,8 +129,9 @@ Decoupling the representational model and downstream tasks. It's divided into tw
118129
# training
119130
ts2vec.fit(train_data)
120131
121-
1.3 Output of training set and test set representation results
122-
==============================================================
132+
2.3 Output of training set and test set representation results
133+
--------------------------------------------------------------
134+
123135
.. code-block:: python
124136
125137
sliding_len = 200 # Use past sliding_len length points to infer the representation of the current point in time
@@ -128,13 +140,10 @@ Decoupling the representational model and downstream tasks. It's divided into tw
128140
train_reprs = all_reprs[:, :split_tag]
129141
test_reprs = all_reprs[:, split_tag:]
130142
131-
2. The second stage:
132-
=======================
133-
- Build training and test samples for regression models
134-
- training and prediction
135143
136-
2.1 Build training and test samples for regression models
137-
=========================================================
144+
2.4 Build training and test samples for regression models
145+
---------------------------------------------------------
146+
138147
.. code-block:: python
139148
140149
# generate samples
@@ -159,8 +168,9 @@ Decoupling the representational model and downstream tasks. It's divided into tw
159168
test_to_numpy = np.expand_dims(test_to_numpy, 0)
160169
test_features, test_labels = generate_pred_samples(test_reprs, test_to_numpy, pre_len)
161170
162-
2.2 Training and prediction
163-
===========================
171+
2.5 Training and prediction
172+
---------------------------
173+
164174
.. code-block:: python
165175
166176
# training

0 commit comments

Comments
 (0)