New instance
Select "Tensorflow enterprise 2.3" > without GPUs
Region: us-central1 (lowa)
Zone: us-central1-a
create
open jupyterlab
open terminal
git clone https://github.com/GoogleCloudPlatform/training-data-analyst
Go to the enclosing folder: training-data-analyst/quests/dei.
Open the notebook file what-if-tool-challenge.ipynb.
Download and import the dataset hmda_2017_ny_all-records_labels.
*to run the cells either you can press run button or press shift+enter in each cell*
[*] - this means the cell is in running state
#this is the size of the array you'll be feeding into our model for each example
model = Sequential()
model.add(layers.Dense(200, input_shape=(input_size,), activation='relu'))
model.add(layers.Dense(50, activation='relu'))
model.add(layers.Dense(20, activation='relu'))
model.add(layers.Dense(1, activation='sigmoid'))
model.compile(loss='mean_squared_error', optimizer='adam', metrics=['accuracy'])
model.fit(train_data, train_labels, epochs=10, batch_size=2048, validation_split=0.1)
#Train your second model on the Limited dataset. Use `Limited_train_data` fir your data and `Limited_train_labels`
limited_model = Sequential()
limited_model.add(layers.Dense(200, input_shape=(input_size,), activation='relu'))
limited_model.add(layers.Dense(50, activation='relu'))
limited_model.add(layers.Dense(20, activation='relu'))
limited_model.add(layers.Dense(1, activation='sigmoid'))
limited_model.compile(loss='mean_squared_error', optimizer='adam', metrics=['accuracy'])
limited_model.fit(limited_train_data, limited_train_labels, epochs=10, batch_size=2048, validation_split=0.1)
Go to cloud storage create bucket and name it by your gcp project id
#Fill out this information
GCP_PROJECT = <PUT_PROJECT_ID>
MODEL_BUCKET = 'gs://<PUT_PROJECT_ID>'
Create the Complete AI Platform model
Use the following to create your first AI Platform model:
Model Name = complete_model
Version Name = v1
Python version = 3.7
Framework = TensorFlow
Framework version = 2.3.1
ML Runtime version = 2.3
Create the Limited AI Platform model
Use the following to create your second AI Platform model:
Model Name = limited_model
Version Name = v1
Python version = 3.7
Framework = TensorFlow
Framework version = 2.3.1
ML Runtime version = 2.3
Comments
Post a Comment