Remove the hard coded block for feature count and disable CUDA

This commit is contained in:
2026-02-17 20:22:02 -08:00
parent 7ff2f994e0
commit c0fd27da07
3 changed files with 5 additions and 2 deletions
+1
View File
@@ -1,4 +1,5 @@
import os import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
import yfinance as yf import yfinance as yf
import features import features
import matplotlib import matplotlib
+2 -1
View File
@@ -3,6 +3,7 @@ import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import datapuller import datapuller
import os import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
from sklearn.model_selection import train_test_split from sklearn.model_selection import train_test_split
from keras import Sequential, layers, optimizers from keras import Sequential, layers, optimizers
@@ -31,7 +32,7 @@ def TrainAI():
# Start with a linear model # Start with a linear model
dnn_linear_model = Sequential([ dnn_linear_model = Sequential([
layers.Input(shape=(9,)), # Explicitly tell Keras there are 9 features layers.Input(shape=(train_features.shape[1],)), # Load the feature count dynamically
normalizer, normalizer,
layers.Dense(64, activation='relu'), layers.Dense(64, activation='relu'),
layers.Dense(64, activation='relu'), layers.Dense(64, activation='relu'),
+2 -1
View File
@@ -58,8 +58,9 @@ RUN wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz && \
ln -s /usr/local/bin/python3.11 /usr/local/bin/python && \ ln -s /usr/local/bin/python3.11 /usr/local/bin/python && \
ln -s /usr/local/bin/pip3.11 /usr/local/bin/pip ln -s /usr/local/bin/pip3.11 /usr/local/bin/pip
# Dont use CUDA for the tensorflow as the CPU is way faster for this smaller workload
RUN pip install --upgrade pip && \ RUN pip install --upgrade pip && \
pip install tensorflow[and-cuda] \ pip install tensorflow \
fastparquet \ fastparquet \
openpyxl \ openpyxl \
yfinance \ yfinance \