Skip to content

Instantly share code, notes, and snippets.

View yufengg's full-sized avatar
💭
Set status

Yufeng yufengg

💭
Set status
View GitHub Profile
// Corresponding spreadsheet: https://docs.google.com/spreadsheets/d/11pse2j9nLimlgyGsxVCtcHY7vBRYchMFslR_rIReNiQ/edit?usp=sharing
function myFunction(event) {
Logger.log(SpreadsheetApp.getActive().getUrl());
Logger.log(JSON.stringify(event));
row_num = event.range.rowStart;
col_num = event.range.columnEnd;
@yufengg
yufengg / AutoML_data_preparation_AIA023.ipynb
Last active July 24, 2024 09:26
Notebook for preparing a CSV for Google Cloud AutoML Vision
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
X = DATA_SETS.test.images[5000:5005]
predict_input_fn =
tf.estimator.inputs.numpy_input_fn(
x={'pixels': X},
batch_size=1,
num_epochs=1,
shuffle=False)
predictions = classifier.predict(
classifier =
tf.estimator.DNNClassifier(
feature_columns=feature_columns,
n_classes=10,
hidden_units=[100, 75, 50],
model_dir=logdir
)
classifier.train(
input_fn=train_input_fn,
steps=num_steps)
accuracy_score = classifier.evaluate(
input_fn=eval_input_fn)['accuracy']
tf.estimator.inputs.numpy_input_fn(
x={'pixels': X},
y=Y,
batch_size=batch_size,
num_epochs=epochs,
shuffle=shuffle)
DATA_SETS = input_data.read_data_sets(
"/tmp/fashion-mnist")
feature_columns = [
tf.feature_column.numeric_column(
"pixels", shape=784)
]
classifier = tf.estimator.LinearClassifier(
feature_columns=feature_columns,
n_classes=10,
model_dir=logdir)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.