|
|
--- |
|
|
tags: |
|
|
- model_hub_mixin |
|
|
- pytorch_model_hub_mixin |
|
|
license: mit |
|
|
--- |
|
|
|
|
|
# LSTMBitCoin: Bitcoin Price Prediction with LSTMs |
|
|
|
|
|
## Model Details |
|
|
|
|
|
- **Model Architecture:** Long Short-Term Memory (LSTM) Network |
|
|
- **Framework:** PyTorch |
|
|
- **Input Shape:** Time series sequences of Bitcoin price data (single feature) |
|
|
- **Output:** Predicted Bitcoin price for the next timestep |
|
|
- **Dataset:** [Bitcoin Historical Data](https://www.kaggle.com/datasets/mczielinski/bitcoin-historical-data) |
|
|
|
|
|
## Model Description |
|
|
|
|
|
The **LSTMBitCoin** model is a **recurrent neural network (RNN)** designed for Bitcoin price prediction. It utilizes a **single-layer LSTM** with **64 hidden units** followed by a **fully connected feedforward network**. The architecture captures temporal dependencies in historical Bitcoin price data. |
|
|
|
|
|
## Training Details |
|
|
|
|
|
- **Optimizer:** Adam |
|
|
- **Batch Size:** 64 |
|
|
- **Loss Function:** Mean Squared Error (MSE) |
|
|
- **Number of Epochs:** 10 |
|
|
- **Dropout:** 50% |
|
|
- **Activation Functions:** ReLU in the feedforward layers |
|
|
|
|
|
### Model Architecture |
|
|
|
|
|
```python |
|
|
class LSTMBitCoin(nn.Module, PyTorchModelHubMixin): |
|
|
def __init__(self): |
|
|
super(LSTMBitCoin, self).__init__() |
|
|
self.lstm = nn.LSTM( |
|
|
input_size=1, hidden_size=64, num_layers=1, batch_first=True, dropout=0.5 |
|
|
) |
|
|
self.seq1 = nn.Sequential( |
|
|
nn.Flatten(), |
|
|
nn.ReLU(), |
|
|
nn.Dropout(0.5), |
|
|
nn.Linear(1280, 32), |
|
|
nn.ReLU(), |
|
|
nn.Dropout(0.5), |
|
|
nn.Linear(32, 1), |
|
|
) |
|
|
|
|
|
def forward(self, x): |
|
|
x, _ = self.lstm(x) |
|
|
x = self.seq1(x) |
|
|
return x.flatten() |
|
|
|
|
|
This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration: |
|
|
- Library: [More Information Needed] |
|
|
- Docs: [More Information Needed] |