Spaces:
Sleeping
Sleeping
hatmanstack commited on
Commit ·
33b6fa7
1
Parent(s): 7178ddf
Search Update
Browse files- .streamlit/config.toml +2 -1
- README.md +7 -7
- compile_model.py +34 -5
- pages/1_home_team.py +7 -11
- pages/2_play_game.py +3 -2
- requirements.txt +1 -1
- winner_model/fingerprint.pb +1 -0
- winner_model/keras_metadata.pb +3 -3
- winner_model/saved_model.pb +0 -0
- winner_model/variables/variables.data-00000-of-00001 +0 -0
- winner_model/variables/variables.index +0 -0
.streamlit/config.toml
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
[theme]
|
| 2 |
base='dark'
|
| 3 |
-
font='sans serif'
|
|
|
|
|
|
| 1 |
[theme]
|
| 2 |
base='dark'
|
| 3 |
+
font='sans serif'
|
| 4 |
+
|
README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
# NBA Fantasy App
|
| 2 |
|
| 3 |
-
This repository has a Streamlit app that lets you create
|
| 4 |
|
| 5 |
-
To determine the winner of each game, the app
|
| 6 |
|
| 7 |
-
The app doesn't consider changes in playstyle or the three-point line.
|
| 8 |
|
| 9 |
## Game
|
| 10 |
Play the game [here](https://hatmanstack-streamlit-nba-app-dz3nxx.streamlit.app/).
|
|
@@ -12,10 +12,10 @@ Play the game [here](https://hatmanstack-streamlit-nba-app-dz3nxx.streamlit.app/
|
|
| 12 |
## Usage
|
| 13 |
To use this app, launch the Streamlit App using the following command install streamlit and then run it:
|
| 14 |
|
| 15 |
-
```
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
## License
|
| 21 |
|
|
|
|
| 1 |
# NBA Fantasy App
|
| 2 |
|
| 3 |
+
This repository has a Streamlit app that lets you create a NBA fantasy team and compete against computer-generated teams. The app uses a Snowflake database that contains historical NBA player data.
|
| 4 |
|
| 5 |
+
To determine the winner of each game, the app uses a functional Keras model that was trained using the 2018 season's game by game results. The model uses season averages in stats from the starting five players as features against thier wins and losses. The training data and model script are included.
|
| 6 |
|
| 7 |
+
The app doesn't consider changes in playstyle or the three-point line when choosing from historical players.
|
| 8 |
|
| 9 |
## Game
|
| 10 |
Play the game [here](https://hatmanstack-streamlit-nba-app-dz3nxx.streamlit.app/).
|
|
|
|
| 12 |
## Usage
|
| 13 |
To use this app, launch the Streamlit App using the following command install streamlit and then run it:
|
| 14 |
|
| 15 |
+
```
|
| 16 |
+
pip install -r requirements.txt
|
| 17 |
+
streamlit run app.py
|
| 18 |
+
```
|
| 19 |
|
| 20 |
## License
|
| 21 |
|
compile_model.py
CHANGED
|
@@ -3,7 +3,8 @@ import numpy as np
|
|
| 3 |
from tensorflow import keras
|
| 4 |
from tensorflow.keras import layers
|
| 5 |
from tensorflow.keras.losses import BinaryCrossentropy
|
| 6 |
-
from sklearn.model_selection import train_test_split
|
|
|
|
| 7 |
|
| 8 |
def create_stats(roster, schedule):
|
| 9 |
home_stats = []
|
|
@@ -32,8 +33,8 @@ schedule['winner'] = schedule.apply(lambda x: 0 if x['PTS'] > x['PTS.1'] else 1,
|
|
| 32 |
|
| 33 |
X = np.array(create_stats(roster, schedule))
|
| 34 |
y = np.array(schedule['winner'])
|
| 35 |
-
|
| 36 |
-
inputs = keras.Input(shape=
|
| 37 |
dense = layers.Dense(50, activation="relu")
|
| 38 |
x = dense(inputs)
|
| 39 |
x = layers.Dense(64, activation="relu")(x)
|
|
@@ -48,8 +49,36 @@ model.compile(
|
|
| 48 |
)
|
| 49 |
|
| 50 |
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
|
| 51 |
-
|
| 52 |
-
|
| 53 |
test_scores = model.evaluate(X_test, y_test, verbose=2)
|
| 54 |
print("Test loss:", test_scores[0])
|
| 55 |
print("Test accuracy:", test_scores[1])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
from tensorflow import keras
|
| 4 |
from tensorflow.keras import layers
|
| 5 |
from tensorflow.keras.losses import BinaryCrossentropy
|
| 6 |
+
from sklearn.model_selection import train_test_split, GridSearchCV
|
| 7 |
+
from sklearn.neural_network import MLPClassifier
|
| 8 |
|
| 9 |
def create_stats(roster, schedule):
|
| 10 |
home_stats = []
|
|
|
|
| 33 |
|
| 34 |
X = np.array(create_stats(roster, schedule))
|
| 35 |
y = np.array(schedule['winner'])
|
| 36 |
+
hidden_layer_sizes = (100,)
|
| 37 |
+
inputs = keras.Input(shape=hidden_layer_sizes)
|
| 38 |
dense = layers.Dense(50, activation="relu")
|
| 39 |
x = dense(inputs)
|
| 40 |
x = layers.Dense(64, activation="relu")(x)
|
|
|
|
| 49 |
)
|
| 50 |
|
| 51 |
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
|
| 52 |
+
model.fit(X_train, y_train, batch_size=64, epochs=500, validation_split=0.2)
|
| 53 |
+
|
| 54 |
test_scores = model.evaluate(X_test, y_test, verbose=2)
|
| 55 |
print("Test loss:", test_scores[0])
|
| 56 |
print("Test accuracy:", test_scores[1])
|
| 57 |
+
|
| 58 |
+
model.save('winner_model')
|
| 59 |
+
# Define the parameter grid for grid search
|
| 60 |
+
param_grid = {
|
| 61 |
+
'hidden_layer_sizes': [(50,), (100,), (50, 50), (100, 50)],
|
| 62 |
+
'activation': ['relu', 'tanh']
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
# Create the classifier (you can use any other model as well)
|
| 66 |
+
classifier = MLPClassifier(max_iter=1000)
|
| 67 |
+
|
| 68 |
+
# Initialize GridSearchCV
|
| 69 |
+
grid_search = GridSearchCV(classifier, param_grid, cv=5, scoring='accuracy', verbose=1, n_jobs=-1)
|
| 70 |
+
|
| 71 |
+
# Perform grid search
|
| 72 |
+
grid_search.fit(X_train, y_train)
|
| 73 |
+
|
| 74 |
+
# Get the best model
|
| 75 |
+
best_model = grid_search.best_estimator_
|
| 76 |
+
|
| 77 |
+
# Train the best model
|
| 78 |
+
best_model.fit(X_train, y_train)
|
| 79 |
+
|
| 80 |
+
# Evaluate the model
|
| 81 |
+
test_scores = best_model.score(X_test, y_test)
|
| 82 |
+
|
| 83 |
+
print("Best Parameters:", grid_search.best_params_)
|
| 84 |
+
print("Test Accuracy:", test_scores)
|
pages/1_home_team.py
CHANGED
|
@@ -12,8 +12,9 @@ col1, col2, col3 = st.columns(3)
|
|
| 12 |
with col2:
|
| 13 |
st.markdown("<h1 style='text-align: center; color: steelblue;'>Build Your Team</h1>", unsafe_allow_html=True)
|
| 14 |
player_add = st.text_input('Who\'re you picking?', 'James')
|
| 15 |
-
|
| 16 |
-
|
|
|
|
| 17 |
|
| 18 |
if 'home_team' not in st.session_state:
|
| 19 |
st.session_state['home_team'] = []
|
|
@@ -48,7 +49,7 @@ def find_home_team():
|
|
| 48 |
cur.execute('SELECT * FROM NBA WHERE FULL_NAME=\'{}\''.format(i))
|
| 49 |
test.append(cur.fetchall()[0])
|
| 50 |
cnx.close()
|
| 51 |
-
df = pd.DataFrame(test, columns=['FULL_NAME', 'AST', 'BLK', 'DREB', 'FG3A', 'FG3M', 'FG3_PCT', 'FGA', 'FGM', 'FG_PCT', 'FTA', 'FTM', 'FT_PCT','GP', 'GS', 'MIN', 'OREB', 'PF', 'PTS', 'REB', 'STL', 'TOV', 'FIRST_NAME', 'LAST_NAME', 'IS_ACTIVE'])
|
| 52 |
st.session_state.home_team_df = df
|
| 53 |
return df
|
| 54 |
|
|
@@ -70,7 +71,7 @@ def save_state():
|
|
| 70 |
for i in saved_players:
|
| 71 |
if i not in player_selected:
|
| 72 |
st.session_state.home_team.remove(i)
|
| 73 |
-
st.
|
| 74 |
|
| 75 |
col1, col2 = st.columns([7,1])
|
| 76 |
with col1:
|
|
@@ -91,27 +92,22 @@ with col3:
|
|
| 91 |
label_visibility="collapsed", )
|
| 92 |
|
| 93 |
if difficulty == 'Regular':
|
| 94 |
-
hard_string = 'Nancy'
|
| 95 |
st.session_state.away_stats = [850, 400, 200, 60]
|
| 96 |
st.session_state.radio_index = 0
|
| 97 |
elif difficulty == '93\' Bulls':
|
| 98 |
-
hard_string = 'True Fan'
|
| 99 |
st.session_state.away_stats = [1050, 500, 300, 80]
|
| 100 |
st.session_state.radio_index = 1
|
| 101 |
elif difficulty == 'All-Stars':
|
| 102 |
-
hard_string = 'Getting Warmer'
|
| 103 |
st.session_state.away_stats = [1250, 600, 400, 100]
|
| 104 |
st.session_state.radio_index = 2
|
| 105 |
elif difficulty == 'Dream Team':
|
| 106 |
-
hard_string = 'Stud'
|
| 107 |
st.session_state.away_stats = [1450, 700, 500, 120]
|
| 108 |
st.session_state.radio_index = 3
|
| 109 |
else:
|
| 110 |
st.write("You didn't select a difficulty.")
|
| 111 |
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
|
| 116 |
|
| 117 |
|
|
|
|
| 12 |
with col2:
|
| 13 |
st.markdown("<h1 style='text-align: center; color: steelblue;'>Build Your Team</h1>", unsafe_allow_html=True)
|
| 14 |
player_add = st.text_input('Who\'re you picking?', 'James')
|
| 15 |
+
player = player_add.lower()
|
| 16 |
+
st.markdown("<p style='text-align: center; color: steelblue;'>Search for a player to populate the dropdown menu then pick and save your team before searching for another player.</p>", unsafe_allow_html=True)
|
| 17 |
+
search_string = 'select full_name from NBA where full_name_lower=\'{}\' or first_name_lower=\'{}\' or last_name_lower=\'{}\';'.format(player, player, player)
|
| 18 |
|
| 19 |
if 'home_team' not in st.session_state:
|
| 20 |
st.session_state['home_team'] = []
|
|
|
|
| 49 |
cur.execute('SELECT * FROM NBA WHERE FULL_NAME=\'{}\''.format(i))
|
| 50 |
test.append(cur.fetchall()[0])
|
| 51 |
cnx.close()
|
| 52 |
+
df = pd.DataFrame(test, columns=['FULL_NAME', 'AST', 'BLK', 'DREB', 'FG3A', 'FG3M', 'FG3_PCT', 'FGA', 'FGM', 'FG_PCT', 'FTA', 'FTM', 'FT_PCT','GP', 'GS', 'MIN', 'OREB', 'PF', 'PTS', 'REB', 'STL', 'TOV', 'FIRST_NAME', 'LAST_NAME', 'FULL_NAME_LOWER', 'FIRST_NAME_LOWER', 'LAST_NAME_LOWER', 'IS_ACTIVE'])
|
| 53 |
st.session_state.home_team_df = df
|
| 54 |
return df
|
| 55 |
|
|
|
|
| 71 |
for i in saved_players:
|
| 72 |
if i not in player_selected:
|
| 73 |
st.session_state.home_team.remove(i)
|
| 74 |
+
st.rerun()
|
| 75 |
|
| 76 |
col1, col2 = st.columns([7,1])
|
| 77 |
with col1:
|
|
|
|
| 92 |
label_visibility="collapsed", )
|
| 93 |
|
| 94 |
if difficulty == 'Regular':
|
|
|
|
| 95 |
st.session_state.away_stats = [850, 400, 200, 60]
|
| 96 |
st.session_state.radio_index = 0
|
| 97 |
elif difficulty == '93\' Bulls':
|
|
|
|
| 98 |
st.session_state.away_stats = [1050, 500, 300, 80]
|
| 99 |
st.session_state.radio_index = 1
|
| 100 |
elif difficulty == 'All-Stars':
|
|
|
|
| 101 |
st.session_state.away_stats = [1250, 600, 400, 100]
|
| 102 |
st.session_state.radio_index = 2
|
| 103 |
elif difficulty == 'Dream Team':
|
|
|
|
| 104 |
st.session_state.away_stats = [1450, 700, 500, 120]
|
| 105 |
st.session_state.radio_index = 3
|
| 106 |
else:
|
| 107 |
st.write("You didn't select a difficulty.")
|
| 108 |
|
| 109 |
+
|
| 110 |
+
|
|
|
|
| 111 |
|
| 112 |
|
| 113 |
|
pages/2_play_game.py
CHANGED
|
@@ -31,7 +31,7 @@ def find_away_team():
|
|
| 31 |
cnx = snowflake.connector.connect(**st.secrets["snowflake"])
|
| 32 |
data = get_away_team(cnx, query_string)
|
| 33 |
cnx.close()
|
| 34 |
-
df = pd.DataFrame(data, columns=['FULL_NAME', 'AST', 'BLK', 'DREB', 'FG3A', 'FG3M', 'FG3_PCT', 'FGA', 'FGM', 'FG_PCT', 'FTA', 'FTM', 'FT_PCT','GP', 'GS', 'MIN', 'OREB', 'PF', 'PTS', 'REB', 'STL', 'TOV', 'FIRST_NAME', 'LAST_NAME', 'IS_ACTIVE'])
|
| 35 |
return df
|
| 36 |
|
| 37 |
if not st.session_state.home_team_df.shape[0] == 5:
|
|
@@ -84,9 +84,10 @@ if teams_good:
|
|
| 84 |
loser_score = random.randint(80, 120)
|
| 85 |
|
| 86 |
|
| 87 |
-
if winner_prediction
|
| 88 |
score.append(get_score_board(winner_prediction, winner_score))
|
| 89 |
score.append(get_score_board(away_point_prediction, loser_score))
|
|
|
|
| 90 |
winner = 'Winner'
|
| 91 |
else:
|
| 92 |
score.append(get_score_board(winner_prediction, loser_score))
|
|
|
|
| 31 |
cnx = snowflake.connector.connect(**st.secrets["snowflake"])
|
| 32 |
data = get_away_team(cnx, query_string)
|
| 33 |
cnx.close()
|
| 34 |
+
df = pd.DataFrame(data, columns=['FULL_NAME', 'AST', 'BLK', 'DREB', 'FG3A', 'FG3M', 'FG3_PCT', 'FGA', 'FGM', 'FG_PCT', 'FTA', 'FTM', 'FT_PCT','GP', 'GS', 'MIN', 'OREB', 'PF', 'PTS', 'REB', 'STL', 'TOV', 'FIRST_NAME', 'LAST_NAME', 'FULL_NAME_LOWER', 'FIRST_NAME_LOWER', 'LAST_NAME_LOWER', 'IS_ACTIVE'])
|
| 35 |
return df
|
| 36 |
|
| 37 |
if not st.session_state.home_team_df.shape[0] == 5:
|
|
|
|
| 84 |
loser_score = random.randint(80, 120)
|
| 85 |
|
| 86 |
|
| 87 |
+
if winner_prediction < 200:
|
| 88 |
score.append(get_score_board(winner_prediction, winner_score))
|
| 89 |
score.append(get_score_board(away_point_prediction, loser_score))
|
| 90 |
+
print(winner_prediction)
|
| 91 |
winner = 'Winner'
|
| 92 |
else:
|
| 93 |
score.append(get_score_board(winner_prediction, loser_score))
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
snowflake-connector-python
|
| 2 |
tensorflow
|
| 3 |
numpy
|
| 4 |
pandas
|
|
|
|
| 1 |
+
snowflake-connector-python==2.8.3
|
| 2 |
tensorflow
|
| 3 |
numpy
|
| 4 |
pandas
|
winner_model/fingerprint.pb
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
��������������ΏϨ������� э�������(��ۓ岩W2
|
winner_model/keras_metadata.pb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
|
| 2 |
-
�
|
| 3 |
�root.layer-0"_tf_keras_input_layer*�{"class_name": "InputLayer", "name": "input_1", "dtype": "float32", "sparse": false, "ragged": false, "batch_input_shape": {"class_name": "__tuple__", "items": [null, 100]}, "config": {"batch_input_shape": {"class_name": "__tuple__", "items": [null, 100]}, "dtype": "float32", "sparse": false, "ragged": false, "name": "input_1"}}2
|
| 4 |
�root.layer_with_weights-0"_tf_keras_layer*�{"name": "dense", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "preserve_input_structure_in_config": false, "autocast": true, "class_name": "Dense", "config": {"name": "dense", "trainable": true, "dtype": "float32", "units": 50, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 1}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 2}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "inbound_nodes": [[["input_1", 0, 0, {}]]], "shared_object_id": 3, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 2, "axes": {"-1": 100}}, "shared_object_id": 14}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 100]}}2
|
| 5 |
�root.layer_with_weights-1"_tf_keras_layer*�{"name": "dense_1", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "preserve_input_structure_in_config": false, "autocast": true, "class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "dtype": "float32", "units": 64, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 4}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 5}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "inbound_nodes": [[["dense", 0, 0, {}]]], "shared_object_id": 6, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 2, "axes": {"-1": 50}}, "shared_object_id": 15}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 50]}}2
|
| 6 |
�root.layer_with_weights-2"_tf_keras_layer*�{"name": "dense_2", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "preserve_input_structure_in_config": false, "autocast": true, "class_name": "Dense", "config": {"name": "dense_2", "trainable": true, "dtype": "float32", "units": 1, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 7}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 8}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "inbound_nodes": [[["dense_1", 0, 0, {}]]], "shared_object_id": 9, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 2, "axes": {"-1": 64}}, "shared_object_id": 16}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 64]}}2
|
| 7 |
-
�
|
| 8 |
-
�
|
|
|
|
| 1 |
|
| 2 |
+
�-root"_tf_keras_network*�,{"name": "nba_model", "trainable": true, "expects_training_arg": true, "dtype": "float32", "batch_input_shape": null, "must_restore_from_config": false, "preserve_input_structure_in_config": false, "autocast": false, "class_name": "Functional", "config": {"name": "nba_model", "trainable": true, "layers": [{"class_name": "InputLayer", "config": {"batch_input_shape": {"class_name": "__tuple__", "items": [null, 100]}, "dtype": "float32", "sparse": false, "ragged": false, "name": "input_1"}, "name": "input_1", "inbound_nodes": []}, {"class_name": "Dense", "config": {"name": "dense", "trainable": true, "dtype": "float32", "units": 50, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "name": "dense", "inbound_nodes": [[["input_1", 0, 0, {}]]]}, {"class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "dtype": "float32", "units": 64, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "name": "dense_1", "inbound_nodes": [[["dense", 0, 0, {}]]]}, {"class_name": "Dense", "config": {"name": "dense_2", "trainable": true, "dtype": "float32", "units": 1, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "name": "dense_2", "inbound_nodes": [[["dense_1", 0, 0, {}]]]}], "input_layers": [["input_1", 0, 0]], "output_layers": [["dense_2", 0, 0]]}, "shared_object_id": 10, "input_spec": [{"class_name": "InputSpec", "config": {"dtype": null, "shape": {"class_name": "__tuple__", "items": [null, 100]}, "ndim": 2, "max_ndim": null, "min_ndim": null, "axes": {}}}], "build_input_shape": {"class_name": "TensorShape", "items": [null, 100]}, "is_graph_network": true, "full_save_spec": {"class_name": "__tuple__", "items": [[{"class_name": "TypeSpec", "type_spec": "tf.TensorSpec", "serialized": [{"class_name": "TensorShape", "items": [null, 100]}, "float32", "input_1"]}], {}]}, "save_spec": {"class_name": "TypeSpec", "type_spec": "tf.TensorSpec", "serialized": [{"class_name": "TensorShape", "items": [null, 100]}, "float32", "input_1"]}, "keras_version": "2.14.0", "backend": "tensorflow", "model_config": {"class_name": "Functional", "config": {"name": "nba_model", "trainable": true, "layers": [{"class_name": "InputLayer", "config": {"batch_input_shape": {"class_name": "__tuple__", "items": [null, 100]}, "dtype": "float32", "sparse": false, "ragged": false, "name": "input_1"}, "name": "input_1", "inbound_nodes": [], "shared_object_id": 0}, {"class_name": "Dense", "config": {"name": "dense", "trainable": true, "dtype": "float32", "units": 50, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 1}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 2}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "name": "dense", "inbound_nodes": [[["input_1", 0, 0, {}]]], "shared_object_id": 3}, {"class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "dtype": "float32", "units": 64, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 4}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 5}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "name": "dense_1", "inbound_nodes": [[["dense", 0, 0, {}]]], "shared_object_id": 6}, {"class_name": "Dense", "config": {"name": "dense_2", "trainable": true, "dtype": "float32", "units": 1, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 7}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 8}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "name": "dense_2", "inbound_nodes": [[["dense_1", 0, 0, {}]]], "shared_object_id": 9}], "input_layers": [["input_1", 0, 0]], "output_layers": [["dense_2", 0, 0]]}}, "training_config": {"loss": {"class_name": "BinaryCrossentropy", "config": {"reduction": "auto", "name": "binary_crossentropy", "from_logits": true, "label_smoothing": 0.0, "axis": -1, "fn": "binary_crossentropy"}, "shared_object_id": 12}, "metrics": [[{"class_name": "MeanMetricWrapper", "config": {"name": "accuracy", "dtype": "float32", "fn": "binary_accuracy"}, "shared_object_id": 13}]], "weighted_metrics": null, "loss_weights": null, "optimizer_config": {"class_name": "Custom>RMSprop", "config": {"name": "RMSprop", "weight_decay": null, "clipnorm": null, "global_clipnorm": null, "clipvalue": null, "use_ema": false, "ema_momentum": 0.99, "ema_overwrite_frequency": 100, "jit_compile": false, "is_legacy_optimizer": false, "learning_rate": 0.0010000000474974513, "rho": 0.9, "momentum": 0.0, "epsilon": 1e-07, "centered": false}}}}2
|
| 3 |
�root.layer-0"_tf_keras_input_layer*�{"class_name": "InputLayer", "name": "input_1", "dtype": "float32", "sparse": false, "ragged": false, "batch_input_shape": {"class_name": "__tuple__", "items": [null, 100]}, "config": {"batch_input_shape": {"class_name": "__tuple__", "items": [null, 100]}, "dtype": "float32", "sparse": false, "ragged": false, "name": "input_1"}}2
|
| 4 |
�root.layer_with_weights-0"_tf_keras_layer*�{"name": "dense", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "preserve_input_structure_in_config": false, "autocast": true, "class_name": "Dense", "config": {"name": "dense", "trainable": true, "dtype": "float32", "units": 50, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 1}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 2}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "inbound_nodes": [[["input_1", 0, 0, {}]]], "shared_object_id": 3, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 2, "axes": {"-1": 100}}, "shared_object_id": 14}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 100]}}2
|
| 5 |
�root.layer_with_weights-1"_tf_keras_layer*�{"name": "dense_1", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "preserve_input_structure_in_config": false, "autocast": true, "class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "dtype": "float32", "units": 64, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 4}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 5}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "inbound_nodes": [[["dense", 0, 0, {}]]], "shared_object_id": 6, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 2, "axes": {"-1": 50}}, "shared_object_id": 15}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 50]}}2
|
| 6 |
�root.layer_with_weights-2"_tf_keras_layer*�{"name": "dense_2", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "preserve_input_structure_in_config": false, "autocast": true, "class_name": "Dense", "config": {"name": "dense_2", "trainable": true, "dtype": "float32", "units": 1, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 7}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 8}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "inbound_nodes": [[["dense_1", 0, 0, {}]]], "shared_object_id": 9, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 2, "axes": {"-1": 64}}, "shared_object_id": 16}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 64]}}2
|
| 7 |
+
�Mroot.keras_api.metrics.0"_tf_keras_metric*�{"class_name": "Mean", "name": "loss", "dtype": "float32", "config": {"name": "loss", "dtype": "float32"}, "shared_object_id": 17}2
|
| 8 |
+
�Nroot.keras_api.metrics.1"_tf_keras_metric*�{"class_name": "MeanMetricWrapper", "name": "accuracy", "dtype": "float32", "config": {"name": "accuracy", "dtype": "float32", "fn": "binary_accuracy"}, "shared_object_id": 13}2
|
winner_model/saved_model.pb
CHANGED
|
Binary files a/winner_model/saved_model.pb and b/winner_model/saved_model.pb differ
|
|
|
winner_model/variables/variables.data-00000-of-00001
CHANGED
|
Binary files a/winner_model/variables/variables.data-00000-of-00001 and b/winner_model/variables/variables.data-00000-of-00001 differ
|
|
|
winner_model/variables/variables.index
CHANGED
|
Binary files a/winner_model/variables/variables.index and b/winner_model/variables/variables.index differ
|
|
|