Skip to content

Commit

Permalink
change for colab
Browse files Browse the repository at this point in the history
  • Loading branch information
ilguyi committed Feb 20, 2019
1 parent fe18ae3 commit dc4e71d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
* LG전자의 주식데이터를 직접 다운 받아서 실제 예측을 해보자
* Train data: 2017년 1월 1일 ~ 2018년 12월 31일 데이터
* Test data: 2019년 1월 1일 ~ 2019년 1월 31일 데이터
* Close price 예측 (baseline은 open price)

#### Dataset
* [Yahoo finance datasets](https://www.imdb.com/interfaces/)
Expand Down
2 changes: 1 addition & 1 deletion cnn/image_classification/image_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Import for Google Colab"
"## Import modules for Google Colab"
]
},
{
Expand Down
57 changes: 47 additions & 10 deletions rnn/sentiment_classification/sentiment_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,38 @@
"To avoid these so-called exploding and vanishing gradients, care must be made when designing the recurrent unit and its gates. That is why the actual implementation of the GRU is more complicated, because it tries to send the gradient back through the gates without this distortion."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Import modules for Google Colab"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# if you necessary\n",
"\n",
"from google.colab import auth\n",
"auth.authenticate_user()\n",
"\n",
"from google.colab import drive\n",
"drive.mount('/content/gdrive')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"use_colab = False\n",
"assert use_colab in [True, False]"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -157,6 +189,7 @@
"\n",
"import os\n",
"import time\n",
"import shutil\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -193,10 +226,18 @@
"source": [
"# if you want to download directly then execute below comment after uncomment\n",
"# else use imdb.py and download.py\n",
"# if use_colab:\n",
"# DATASET_PATH='./gdrive/My Drive/datasets/IMDB'\n",
"# else:\n",
"# DATASET_PATH='../../datasets/IMDB'\n",
"\n",
"# !wget http://ai.stanford.edu/~amaas/data/sentiment/aclImdb_v1.tar.gz\n",
"# !tar xvzf aclImdb_v1.tar.gz\n",
"# !mkdir ../../datasets/IMDB\n",
"# !mv aclImdb ../../datasets/IMDB\n",
"\n",
"# if not os.path.isdir(DATASET_PATH):\n",
"# os.makedirs(DATASET_PATH)\n",
"# shutil.move(os.path.join('aclImdb_v1'), os.path.join(DATASET_PATH))\n",
"\n",
"# !rm aclImdb_v1.tar.gz"
]
},
Expand All @@ -209,20 +250,16 @@
"import imdb"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Change this if you want the files saved in another directory."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"imdb.data_dir = \"../../datasets/IMDB/\""
"if use_colab:\n",
" imdb.data_dir = './gdrive/My Drive/datasets/IMDB'\n",
"else:\n",
" imdb.data_dir = '../../datasets/IMDB'"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions rnn/stock_price_prediction/stock_price_prediction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
"* LG전자의 주식데이터를 직접 다운 받아서 실제 예측을 해보자\n",
" * Train data: 2017년 1월 1일 ~ 2018년 12월 31일 데이터\n",
" * Test data: 2019년 1월 1일 ~ 2019년 1월 31일 데이터\n",
" * Close price 예측 (baseline은 open price)\n",
"\n",
"### Dataset\n",
"* [Yahoo finance datasets](https://www.imdb.com/interfaces/)\n",
"* 2-3년간 daily stock price 데이터를 이용하여 미래 한달의 주식가격을 예측\n",
"\n",
"### Base code\n",
"### Baseline code\n",
"* Dataset: train, test로 split\n",
"* Input data shape: (`batch_size`, `past_day`=60, 1)\n",
"* Output data shape: (`batch_size`, 1)\n",
Expand Down Expand Up @@ -60,7 +61,6 @@
"import os\n",
"import sys\n",
"import time\n",
"import glob\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
Expand Down

0 comments on commit dc4e71d

Please sign in to comment.