This file contains 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
def plot_timings(loader, n_batches, model_time=0.2, max_time=2.5): | |
fig, ax = plt.subplots() | |
ax.set_axisbelow(True) | |
ax.yaxis.grid(which="major", color='black', linewidth=1) | |
zero_time = time.time() | |
worker_ids = {} | |
worker_count = count() |
This file contains 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 bokeh.models import CustomJS, ColumnDataSource | |
source = ColumnDataSource(data=dict(x=[0,0], y=[0, 80])) | |
# Javascript | |
callback = CustomJS(args=dict(source=source), code=""" | |
var data = source.data; | |
var f = cb_obj.value | |
data['x'] = [f, f] |
This file contains 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
# Forked from nathanielatom, updated to work with typescript and bokeh==1.3.4 | |
from bokeh.layouts import column, layout | |
from bokeh.models import CustomJS, Model, LayoutDOM | |
from bokeh.document import Document | |
from bokeh.models.widgets import Button, Slider, Toggle | |
from bokeh.core.properties import Instance, String | |
from bokeh.io import save, output_file, show | |
from bokeh.util.compiler import TypeScript | |
from fontawesome.fontawesome_icon import FontAwesomeIcon as Icon | |
# Requires https://github.com/bokeh/bokeh/tree/master/examples/custom/font-awesome |
This file contains 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
layer_dict = {} | |
def inspect_layer(module, input, output): | |
global layer_dict | |
layer_dict[module] = (input, output) | |
handles = [layer.register_forward_hook(inspect_layer) for layer in output_layers] | |
# handles[0].remove() |
This file contains 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
x |
This file contains 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 pydrive.auth import GoogleAuth | |
from pydrive.drive import GoogleDrive | |
from google.colab import auth | |
from oauth2client.client import GoogleCredentials | |
auth.authenticate_user() | |
gauth = GoogleAuth() | |
gauth.credentials = GoogleCredentials.get_application_default() | |
drive = GoogleDrive(gauth) |
This file contains 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 tensorflow as tf | |
from object_detection.anchor_generators.multiple_grid_anchor_generator import create_ssd_anchors | |
from object_detection.models.ssd_mobilenet_v2_feature_extractor_test import SsdMobilenetV2FeatureExtractorTest | |
import matplotlib.pyplot as plt | |
from matplotlib import patches | |
import numpy as np | |
def get_feature_map_shapes(image_height, image_width): | |
""" |
This file contains 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
# Examples of calls to various tensorflow features from CLI | |
# Load graph to tensorboard | |
python -m tensorflow.python.tools.import_pb_to_tensorboard |
This file contains 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
set-option -g prefix C-a | |
set -g mouse on | |
# remember to run tmux source-file ~/.tmux.conf |
This file contains 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
if [[ -z "$TMUX" ]]; then | |
tmux new -d -s jn | |
tmux send -t jn "jupyter notebook" ENTER | |
fi |
NewerOlder