progress
This commit is contained in:
parent
3dc9d91e48
commit
6b84da949f
@ -11,6 +11,7 @@ services:
|
||||
image: cvtt/fastai:v0.0.1
|
||||
container_name: fastai_jupyter
|
||||
runtime: nvidia
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- JUPYTER_ENABLE_LAB=yes
|
||||
volumes:
|
||||
|
||||
BIN
pytorch/.docker-compose.yml.swp
Normal file
BIN
pytorch/.docker-compose.yml.swp
Normal file
Binary file not shown.
@ -10,7 +10,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"execution_count": 2,
|
||||
"id": "6b269e64-be58-43b5-ad60-0fbd1d37861a",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@ -19,7 +19,8 @@
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"CUDA is available. Number of GPUs: 1\n",
|
||||
"GPU Name: NVIDIA GeForce RTX 3060\n"
|
||||
"GPU Name: NVIDIA GeForce RTX 3060\n",
|
||||
"GPU Capability: 8\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -30,6 +31,7 @@
|
||||
"if torch.cuda.is_available():\n",
|
||||
" print(f\"CUDA is available. Number of GPUs: {torch.cuda.device_count()}\")\n",
|
||||
" print(f\"GPU Name: {torch.cuda.get_device_name(0)}\")\n",
|
||||
" print(f\"GPU Capability: {torch.cuda.get_device_capability()[0]}\")\n",
|
||||
"else:\n",
|
||||
" print(\"CUDA is not available. No GPU detected.\")\n"
|
||||
]
|
||||
|
||||
@ -14,8 +14,10 @@ services:
|
||||
image: cvtt/jupyter_gpu_tf:v1.0.7
|
||||
container_name: jupyter_gpu_tf
|
||||
runtime: nvidia
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- JUPYTER_ENABLE_LAB=yes
|
||||
#- PYTHONPATH=/cvtt/prod
|
||||
- TF_CACHE_DIR=/workspace/tf_cache
|
||||
volumes:
|
||||
- ${ROOT_DIR}/notebooks:/workspace
|
||||
|
||||
@ -1493,7 +1493,9 @@
|
||||
"cell_type": "code",
|
||||
"execution_count": 255,
|
||||
"id": "7a9e8c46-d24e-4ce9-b20a-232b4a86dab6",
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"scrolled": true
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
@ -1514,11 +1516,39 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "39259ac7-422b-48dc-aecd-2c9799ae3066",
|
||||
"id": "14eb03d2-1dbe-4834-908f-5a520a4a28c5",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "598f83ca-cbb1-44f8-a1c6-7ce84f2243d7",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"id": "39259ac7-422b-48dc-aecd-2c9799ae3066",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"ename": "NameError",
|
||||
"evalue": "name 'sample_test' is not defined",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
|
||||
"Cell \u001b[0;32mIn[1], line 5\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# variables are close and volume\u001b[39;00m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;66;03m# ==============================\u001b[39;00m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;66;03m# Test Sample --- 06.14.2024\u001b[39;00m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;66;03m# ==============================\u001b[39;00m\n\u001b[0;32m----> 5\u001b[0m sample_size \u001b[38;5;241m=\u001b[39m \u001b[43msample_test\u001b[49m\u001b[38;5;241m.\u001b[39mshape[\u001b[38;5;241m0\u001b[39m]\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28mprint\u001b[39m (\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msample_size: \u001b[39m\u001b[38;5;124m'\u001b[39m, sample_size)\n\u001b[1;32m 8\u001b[0m sl \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m16\u001b[39m \u001b[38;5;66;03m# <--- sequence length\u001b[39;00m\n",
|
||||
"\u001b[0;31mNameError\u001b[0m: name 'sample_test' is not defined"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# variables are close and volume\n",
|
||||
"# variables are volume and volume\n",
|
||||
"# ==============================\n",
|
||||
"# Test Sample --- 06.14.2024\n",
|
||||
"# ==============================\n",
|
||||
@ -1556,16 +1586,28 @@
|
||||
"\n",
|
||||
"print (selected_indices)\n",
|
||||
"\n",
|
||||
"all_ts_xrp = np.empty((1, )) # final input/output\n",
|
||||
"all_ts_eth = np.empty((1, )) # final input/output\n",
|
||||
"all_ts_ltc = np.empty((1, )) # final input/output\n",
|
||||
"all_ts_btc = np.empty((1, )) # final input/output\n",
|
||||
"# all_ts_xrp = np.empty((1, )) # final input/output\n",
|
||||
"# all_ts_eth = np.empty((1, )) # final input/output\n",
|
||||
"# all_ts_ltc = np.empty((1, )) # final input/output\n",
|
||||
"# all_ts_btc = np.empty((1, )) # final input/output\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"all_ts_close_xrp = np.empty((1, )) # final input/output\n",
|
||||
"all_ts_close_eth = np.empty((1, )) # final input/output\n",
|
||||
"all_ts_close_ltc = np.empty((1, )) # final input/output\n",
|
||||
"all_ts_close_btc = np.empty((1, )) # final input/output\n",
|
||||
"\n",
|
||||
"all_ts_volume_xrp = np.empty((1, )) # final input/output\n",
|
||||
"all_ts_volume_eth = np.empty((1, )) # final input/output\n",
|
||||
"all_ts_volume_ltc = np.empty((1, )) # final input/output\n",
|
||||
"all_ts_volume_btc = np.empty((1, )) # final input/output\n",
|
||||
"\n",
|
||||
"stdev_xrp = np.empty((1, )) # final input/output\n",
|
||||
"stdev_eth = np.empty((1, )) # final input/output\n",
|
||||
"stdev_ltc = np.empty((1, )) # final input/output\n",
|
||||
"stdev_btc = np.empty((1, )) # final input/output\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"aft_ts_xrp = np.empty((1))\n",
|
||||
"aft_ts_eth = np.empty((1))\n",
|
||||
"aft_ts_ltc = np.empty((1))\n",
|
||||
@ -1575,71 +1617,93 @@
|
||||
" selected_rows_before = sample_test.iloc[max(0, idx-sl): idx]\n",
|
||||
" selected_rows_after = sample_test.iloc[max(0, idx): idx+frwd]\n",
|
||||
"\n",
|
||||
" # print ('====================')\n",
|
||||
" sr_before_vwap_xrp = np.array(selected_rows_before['vwap_xrp'])\n",
|
||||
" sr_after_vwap_xrp = np.array(selected_rows_after['vwap_xrp']) \n",
|
||||
" # print (sr_before_vwap_xrp)\n",
|
||||
"\n",
|
||||
" # xrp\n",
|
||||
" sr_before_close_xrp = np.array(selected_rows_before['close_xrp'])\n",
|
||||
" sr_after_close_xrp = np.array(selected_rows_after['close_xrp']) \n",
|
||||
" # print (sr_before_close_xrp)\n",
|
||||
" sr_before_volume_xrp = np.array(selected_rows_before['volume_xrp'])\n",
|
||||
" sr_after_volume_xrp = np.array(selected_rows_after['volume_xrp']) \n",
|
||||
" # print (sr_before_volume_xrp) \n",
|
||||
" # Compute standard deviation\n",
|
||||
" std_dev_xrp = np.std(sr_before_vwap_xrp)\n",
|
||||
" std_dev_xrp = np.std(sr_before_close_xrp)\n",
|
||||
" std_dev_xrp_arr = np.repeat(std_dev_xrp, sl)\n",
|
||||
" # print(std_dev_xrp_arr)\n",
|
||||
" \n",
|
||||
" sr_before_vwap_eth = np.array(selected_rows_before['vwap_eth'])\n",
|
||||
" sr_after_vwap_eth = np.array(selected_rows_after['vwap_eth'])\n",
|
||||
"\n",
|
||||
"# eth\n",
|
||||
" sr_before_close_eth = np.array(selected_rows_before['close_eth'])\n",
|
||||
" sr_after_close_eth = np.array(selected_rows_after['close_eth'])\n",
|
||||
" sr_before_volume_eth = np.array(selected_rows_before['volume_eth'])\n",
|
||||
" sr_after_volume_eth = np.array(selected_rows_after['volume_eth'])\n",
|
||||
" # Compute standard deviation\n",
|
||||
" std_dev_eth = np.std(sr_before_vwap_eth)\n",
|
||||
" std_dev_eth = np.std(sr_before_close_eth)\n",
|
||||
" std_dev_eth_arr = np.repeat(std_dev_eth, sl)\n",
|
||||
" # print(std_dev_eth_arr)\n",
|
||||
" \n",
|
||||
"\n",
|
||||
" sr_before_vwap_ltc = np.array(selected_rows_before['vwap_ltc'])\n",
|
||||
" sr_after_vwap_ltc = np.array(selected_rows_after['vwap_ltc'])\n",
|
||||
"\n",
|
||||
"# ltc\n",
|
||||
" sr_before_close_ltc = np.array(selected_rows_before['close_ltc'])\n",
|
||||
" sr_after_close_ltc = np.array(selected_rows_after['close_ltc'])\n",
|
||||
" sr_before_volume_ltc = np.array(selected_rows_before['volume_ltc'])\n",
|
||||
" sr_after_volume_ltc = np.array(selected_rows_after['volume_ltc'])\n",
|
||||
"# Compute standard deviation\n",
|
||||
" std_dev_ltc = np.std(sr_before_vwap_ltc)\n",
|
||||
" std_dev_ltc = np.std(sr_before_close_ltc)\n",
|
||||
" std_dev_ltc_arr = np.repeat(std_dev_ltc, sl)\n",
|
||||
" # print(std_dev_ltc_arr)\n",
|
||||
"\n",
|
||||
" sr_before_vwap_btc = np.array(selected_rows_before['vwap_btc'])\n",
|
||||
" sr_after_vwap_btc = np.array(selected_rows_after['vwap_btc'])\n",
|
||||
"\n",
|
||||
"# btc\n",
|
||||
" sr_before_close_btc = np.array(selected_rows_before['close_btc'])\n",
|
||||
" sr_after_close_btc = np.array(selected_rows_after['close_btc'])\n",
|
||||
" sr_before_volume_btc = np.array(selected_rows_before['volume_btc'])\n",
|
||||
" sr_after_volume_btc = np.array(selected_rows_after['volume_btc'])\n",
|
||||
" # Compute standard deviation\n",
|
||||
" std_dev_btc = np.std(sr_before_vwap_btc)\n",
|
||||
" std_dev_btc = np.std(sr_before_close_btc)\n",
|
||||
" std_dev_btc_arr = np.repeat(std_dev_btc, sl)\n",
|
||||
" # print(std_dev_btc_arr)\n",
|
||||
"\n",
|
||||
" all_ts_xrp = np.concatenate((all_ts_xrp, sr_before_vwap_xrp))\n",
|
||||
"# xrp\n",
|
||||
" all_ts_close_xrp = np.concatenate((all_ts_close_xrp, sr_before_close_xrp))\n",
|
||||
" all_ts_volume_xrp = np.concatenate((all_ts_volume_xrp, sr_before_volume_xrp))\n",
|
||||
" stdev_xrp = np.concatenate((stdev_xrp, std_dev_xrp_arr))\n",
|
||||
" \n",
|
||||
" all_ts_eth = np.concatenate((all_ts_eth, sr_before_vwap_eth))\n",
|
||||
"# eth\n",
|
||||
" all_ts_close_eth = np.concatenate((all_ts_close_eth, sr_before_close_eth))\n",
|
||||
" all_ts_volume_eth = np.concatenate((all_ts_volume_eth, sr_before_volume_eth))\n",
|
||||
" stdev_eth = np.concatenate((stdev_eth, std_dev_eth_arr))\n",
|
||||
"\n",
|
||||
" all_ts_ltc = np.concatenate((all_ts_ltc, sr_before_vwap_ltc))\n",
|
||||
"# ltc\n",
|
||||
" all_ts_close_ltc = np.concatenate((all_ts_close_ltc, sr_before_close_ltc))\n",
|
||||
" all_ts_volume_ltc = np.concatenate((all_ts_volume_ltc, sr_before_volume_tc))\n",
|
||||
" stdev_ltc = np.concatenate((stdev_ltc, std_dev_ltc_arr))\n",
|
||||
"\n",
|
||||
" all_ts_btc = np.concatenate((all_ts_btc, sr_before_vwap_btc))\n",
|
||||
"# btc\n",
|
||||
" all_ts_close_btc = np.concatenate((all_ts_close_btc, sr_before_close_btc))\n",
|
||||
" all_ts_volume_btc = np.concatenate((all_ts_volume_btc, sr_before_volume_btc))\n",
|
||||
" stdev_btc = np.concatenate((stdev_btc, std_dev_btc_arr))\n",
|
||||
"\n",
|
||||
" aft_ts_xrp = np.concatenate((aft_ts_xrp, sr_after_vwap_xrp))\n",
|
||||
" aft_ts_eth = np.concatenate((aft_ts_eth, sr_after_vwap_eth))\n",
|
||||
" aft_ts_ltc = np.concatenate((aft_ts_ltc, sr_after_vwap_ltc))\n",
|
||||
" aft_ts_btc = np.concatenate((aft_ts_btc, sr_after_vwap_btc))\n",
|
||||
"\n",
|
||||
"X_XRP = all_ts_xrp[1:]\n",
|
||||
" aft_ts_close_xrp = np.concatenate((aft_ts_close_xrp, sr_after_close_xrp))\n",
|
||||
" aft_ts_close_eth = np.concatenate((aft_ts_close_eth, sr_after_close_eth))\n",
|
||||
" aft_ts_close_ltc = np.concatenate((aft_ts_close_ltc, sr_after_close_ltc))\n",
|
||||
" aft_ts_close_btc = np.concatenate((aft_ts_close_btc, sr_after_close_btc))\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"X_XRP_close = all_ts_close_xrp[1:]\n",
|
||||
"X_XRP_volume = all_ts_volume_xrp[1:]\n",
|
||||
"X_XRP_stdev = stdev_xrp[1:]\n",
|
||||
"\n",
|
||||
"X_ETH = all_ts_eth[1:]\n",
|
||||
"\n",
|
||||
"X_ETH_close = all_ts_close_eth[1:]\n",
|
||||
"X_ETH_volume = all_ts_volume_eth[1:]\n",
|
||||
"X_ETH_stdev = stdev_eth[1:]\n",
|
||||
"\n",
|
||||
"X_LTC = all_ts_ltc[1:]\n",
|
||||
"X_LTC_close = all_ts_close_ltc[1:]\n",
|
||||
"X_LTC_volume = all_ts_volume_ltc[1:]\n",
|
||||
"X_LTC_stdev = stdev_ltc[1:]\n",
|
||||
"\n",
|
||||
"X_BTC = all_ts_btc[1:]\n",
|
||||
"X_BTC_close = all_ts_close_btc[1:]\n",
|
||||
"X_BTC_volume = all_ts_volume_btc[1:]\n",
|
||||
"X_BTC_stdev = stdev_btc[1:]\n",
|
||||
"\n",
|
||||
"X0 = np.column_stack((X_XRP, X_XRP_stdev, X_ETH, X_ETH_stdev, X_LTC, X_LTC_stdev, X_BTC, X_BTC_stdev))\n",
|
||||
"X0 = np.column_stack((X_XRP_close, X_XRP_volume, \n",
|
||||
" X_ETH_close, X_ETH_volume, \n",
|
||||
" X_LTC_close, X_LTC_volume, \n",
|
||||
" X_BTC_close, X_BTC_volume))\n",
|
||||
"print (X0)\n",
|
||||
"\n",
|
||||
"# ======== Model Input =========\n",
|
||||
|
||||
4918
tensorflow/notebooks/leo/LSTM_All_Crypto_02.ipynb
Normal file
4918
tensorflow/notebooks/leo/LSTM_All_Crypto_02.ipynb
Normal file
File diff suppressed because one or more lines are too long
3368
tensorflow/notebooks/leo/LSTM_All_Crypto_Simple.ipynb
Normal file
3368
tensorflow/notebooks/leo/LSTM_All_Crypto_Simple.ipynb
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user