Skip to content

Commit 9f06411

Browse files
committed
Update README.md
1 parent 80ab7db commit 9f06411

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The project is grouped into the following sections, which are representative of
1818

1919
By the end of this project, you will have a fully functional LSTM model that predicts future stock prices based on historical price movements, all in a single Python file. This tutorial has been written in a way such that all the essential code snippets have been embedded inline. You should be able to develop, train, and test your machine learning model without referring to other external pages or documents.
2020

21-
Let's get started!
21+
Let's get started!
2222

2323
## Installing Python dependencies
2424

@@ -31,6 +31,9 @@ With Python installed, please go to the Command Line interface of your operating
3131
- [Matplotlib](https://github.com/matplotlib/matplotlib) - `pip install matplotlib`
3232
- [alpha_vantage](https://github.com/RomelTorres/alpha_vantage) - `pip install alpha_vantage`
3333

34+
<details>
35+
<summary>Create your Python file and follow along the codes in this tutorial</summary>
36+
3437
Now, create a new Python file named `project.py` and paste the following code into the file:
3538

3639
```python
@@ -93,6 +96,7 @@ config = {
9396
```
9497

9598
Over the course of this project, we will continue adding new code blocks to the **project.py** file. By the time you reach the end of the tutorial, you should have a fully functional LSTM machine learning model to predict stock market price movements, all in a single Python script. Please feel free to compare your **project.py** with the [official copy](https://github.com/jinglescode/time-series-forecasting-pytorch/blob/main/project.py) if you would like to have a "sanity check" anytime during the project.
99+
</details>
96100

97101
## Data preparation: acquiring financial market data from Alpha Vantage
98102

@@ -404,6 +408,8 @@ for epoch in range(config["training"]["num_epoch"]):
404408
.format(epoch+1, config["training"]["num_epoch"], loss_train, loss_val, lr_train))
405409
```
406410

411+
Using *mean squared error* as the loss function to optimize our model, we calculate the loss on training and validation based on how well the model is doing in these two sets. After every epoch, a smaller *loss* value indicates that the model is learning and 0.0 means that no mistakes were made. `Loss train` gives an idea of how well the model is learning, while `loss test` gives an idea of how well the model generalizes on the validation dataset.
412+
407413
Console showing the loss and learning rate during training:
408414

409415
```

0 commit comments

Comments
 (0)