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 euler_loss(y_true, y_pred): | |
dist1 = tf.abs(y_true - y_pred) | |
dist2 = tf.abs(2*np.pi + y_true - y_pred) | |
dist3 = tf.abs(-2*np.pi + y_true - y_pred) | |
loss = tf.where(dist1<dist2, dist1, dist2) | |
loss = tf.where(loss<dist3, loss, dist3) | |
return tf.reduce_mean(loss) | |
def quaternion_loss(y_true, y_pred): | |
dist1 = tf.reduce_mean(tf.abs(y_true-y_pred), axis=-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
def get_R(angles): | |
''' Get rotation matrix from three rotation angles (radians). right-handed. | |
Args: | |
angles: [3,]. x, y, z angles | |
Returns: | |
R: [3, 3]. rotation matrix. | |
''' | |
x, y, z = angles.astype(np.float32) | |
# x | |
Rx = np.array([[1, 0, 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
name: "VGG_CNN_M_128" | |
layer { | |
name: "data" | |
type: "Data" | |
top: "data" | |
include { | |
phase: TRAIN | |
} | |
transform_param { | |
mirror: true |
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
input { | |
file { | |
path => "/opt/jboss-as/standalone/log/server.log" | |
start_position => end | |
add_field => { "host" => "test" } | |
codec => multiline { | |
pattern => "^\d\d:\d\d:\d\d,\d\d\d" | |
negate => true | |
what => "previous" | |
} |
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
create file with the following content and set timer to run this script every day: | |
> crontab -e | |
add this line to the end of file: | |
* * */1 * * /etc/elasticsearch/logstash-delete-index.sh -i 3 | |
-i 3 will remain 3 most recent indecies for you | |
#!/bin/bash | |
# elasticsearch-remove-old-indices.sh |
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
input { | |
file { | |
path => "/Users/virtuozzo/Servers/jboss-as-7.1.1.Final/standalone/log/server.log" | |
start_position => end | |
} | |
} | |
filter { | |
mutate { replace => { "type" => "local-jboss" } } | |
grok { |
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
vi ~/.bash_profile | |
add | |
export JAVA_HOME=`/usr/libexec/java_home -v 1.7` | |
This tells your /usr/bin/java link target to use the latest Java 7 Package installed in | |
/Library/Java/JavaVirtualMachines/ |
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
apt-get install ruby1.9.1-dev | |
apt-get install rubygems | |
gem install jekyll | |
apt-get install nodejs |
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
\documentclass[a4paper,12pt]{article} | |
\usepackage[utf8x]{inputenc} % more recent versions (at least>=2004-17-10) | |
\usepackage[russian]{babel} | |
\author{A. S. Pushkin} | |
\title{Зимнее утро (winter morning)} |