This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from tensorflow.keras.callbacks import EarlyStopping | |
| early_stop = EarlyStopping( | |
| monitor='val_loss', min_delta=0, patience=5, verbose=0, mode='auto', | |
| baseline=None, restore_best_weights=True) | |
| model.fit(x_train, {device:y_train for device in device_names}, | |
| batch_size=64, | |
| epochs=1000, | |
| verbose=1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| from scipy.special import softmax | |
| def get_results(confidence_threshold): | |
| print('confidence threshold:',confidence_threshold) | |
| predictions = [] | |
| confidence = [] | |
| exit_level = [] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib.pyplot as plt | |
| def show_image_compression(samples): | |
| #get encoded samples offloaded to edge | |
| _, offload_end = device_models['end'].predict(samples) | |
| #get encoded samples offloaded to cloud | |
| _, offload_edge = device_models['edge'].predict(offload_end) | |
| #show sample represenations at each device level | |
| for i in range(len(samples)): | |
| print(i) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer