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
echo 'deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64 /' > /etc/apt/sources.list.d/cuda.list | |
echo 'deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1404/x86_64 /' > /etc/apt/sources.list.d/nvidia-ml.list | |
apt-get update | |
apt-get install --force-yes -y nvidia-352 | |
apt-get install --force-yes -y cuda-7-5 cuda-command-line-tools-7-5 cuda-core-7-5 cuda-cublas-7-5 cuda-cublas-dev-7-5 cuda-cudart-7-5 cuda-cudart-dev-7-5 cuda-cufft-7-5 cuda-cufft-dev-7-5 cuda-curand-7-5 cuda-curand-dev-7-5 cuda-cusolver-7-5 cuda-cusolver-dev-7-5 cuda-cusparse-7-5 cuda-cusparse-dev-7-5 cuda-documentation-7-5 cuda-driver-dev-7-5 cuda-gdb-src-7-5 cuda-ld-conf-7-5 cuda-license-7-5 cuda-minimal-build-7-5 cuda-misc-headers-7-5 cuda-npp-7-5 cuda-npp-dev-7-5 cuda-nvrtc-7-5 cuda-nvrtc-dev-7-5 cuda-runtime-7-5 cuda-samples-7-5 cuda-toolkit-7-5 cuda-visual-tools-7-5 | |
apt-get install -y build-essential python-dev python-virtualenv python-pip | |
apt-get install -y libatlas-dev liblapack-dev | |
ap |
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 'package:flutter/material.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
enum ChildType { a, b } | |
class ChildState<T> { |
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
session_config = tf.ConfigProto( | |
intra_op_parallelism_threads=64, | |
inter_op_parallelism_threads=4, | |
) | |
... | |
run_config = tpu.RunConfig( | |
session_config=session_config, |
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 tensorflow.core.protobuf import rewriter_config_pb2 | |
config = tf.ConfigProto() | |
config.graph_options.rewrite_options.memory_optimization = ( | |
rewriter_config_pb2.RewriterConfig.NO_MEM_OPT) | |
off = rewriter_config_pb2.RewriterConfig.OFF | |
config.graph_options.rewrite_options.layout_optimizer = off | |
config.graph_options.rewrite_options.constant_folding = off | |
config.graph_options.rewrite_options.arithmetic_optimization = off | |
config.graph_options.rewrite_options.dependency_optimization = off | |
config.graph_options.rewrite_options.loop_optimization = off |
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 | |
import sys | |
from tensorflow.contrib.tpu.python.tpu import session_support | |
def reset_tpu(name): | |
print('Resetting: %s' % name) | |
resolver = tf.contrib.cluster_resolver.TPUClusterResolver(tpu=name, job_name='worker') | |
address = resolver.master() | |
cluster_def = resolver.cluster_spec().as_cluster_def() | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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 numpy as np | |
from keras.models import Sequential | |
from keras.layers.core import Dense, Activation, Dropout, TimeDistributedDense | |
from keras.layers.recurrent import LSTM | |
text = open('/home/russellp/w/data/citation-graph/abstracts.txt', 'r').read() | |
char_to_idx = { ch: i for (i, ch) in enumerate(sorted(list(set(text)))) } | |
idx_to_char = { i: ch for (ch, i) in char_to_idx.items() } | |
vocab_size = len(char_to_idx) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder