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 keras.backend as K | |
import keras.losses as losses | |
import keras.metrics as metrics | |
def zero_loss(targets, outputs): | |
return losses.categorical_crossentropy(targets, outputs)*0 | |
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 keras import backend as K | |
def masked_categorical_crossentropy(y_true, y_pred): | |
mask = K.cast(K.not_equal(y_true, -1), K.floatx()) | |
return K.categorical_crossentropy(y_true * mask, y_pred * mask) | |
def masked_categorical_accuracy(y_true, y_pred): | |
mask = K.cast(K.not_equal(y_true, -1), K.floatx()) | |
return metrics.categorical_accuracy(y_true * mask, y_pred * mask) | |
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 = SpatialDropout1D(rate=0.1)(input_i) | |
x = Bidirectional(CuDNNGRU(50, return_sequences=True))(x) | |
layer_outputs.append(x[:,-1,:]) # <- Not OK, | |
layer_outputs.append(GlobalAvgPool1D()(x)) # OK | |
layer_outputs.append(GlobalMaxPool1D()(x)) # OK |
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
#!/usr/bin/env bash | |
set -e | |
instances=$(echo {0..2}) | |
public_ip=$(hostname -I | cut -d' ' -f1) | |
peers=$(for i in $instances; do echo "etcd.$i=http://${public_ip}:$((2380+$i*100))"; done | tr '\n' ',') | |
for i in $instances | |
do |
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
----------------- YAML ----------------- | |
global_host_alias: | |
query_port: 2099 | |
outputWriters: | |
- "@class": "com.googlecode.jmxtrans.model.output.GraphiteWriter" | |
settings: | |
host: "localhost" | |
port: 8080 | |
rootPrefix: jmxtrans |
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
----------------- YAML ----------------- | |
global_host_alias: | |
query_port: 2099 | |
outputWriters: | |
- "@class": "com.googlecode.jmxtrans.model.output.GraphiteWriter" | |
settings: | |
host: "localhost" | |
port: 8080 | |
rootPrefix: jmxtrans |
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
diff --git a/pom.xml b/pom.xml | |
index 6495076..7ba5892 100644 | |
--- a/pom.xml | |
+++ b/pom.xml | |
@@ -118,6 +118,7 @@ | |
<configuration> | |
<shadedArtifactAttached>true</shadedArtifactAttached> | |
<shadedClassifierName>all</shadedClassifierName> | |
+ <finalName>${project.artifactId}-all</finalName> | |
</configuration> |