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.
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.
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
def get_updates(model, loss): | |
updates = [] | |
grad = SomeLibrary.grad(model.params, loss) | |
for param, g in zip(model.params, grad): | |
updates.append((params, param + model.lr * g)) | |
return updates | |
def murderbot(): | |
model = make_model() | |
while True: |
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.
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
''' | |
super ugly. but works. | |
''' | |
import subprocess | |
import time | |
while True: | |
ps = subprocess.Popen(['qstat'], stdout=subprocess.PIPE).communicate()[0] | |
jid = int(ps.split("\n")[2].split(" ")[0]) |
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
class Lambda(Layer): | |
'''Used for evaluating an arbitrary Theano / TensorFlow expression | |
on the output of the previous layer. | |
# Examples | |
```python | |
# add a x -> x^2 layer | |
model.add(Lambda(lambda x: x ** 2)) | |
``` |
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
''' | |
use as: | |
some_data = DataLayer(K.variable(some_tensor,dtype=whatever), ...) | |
next_layer = Dense(some_number) | |
out_tensor = next_layer(some_data.tensor) | |
''' | |
class DataLayer(Layer): | |
'''TODO: dosctring | |
''' | |
def __init__(self, input_tensor, input_dtype=None, name=None): |