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
| public interface Attachable { | |
| public File getFile(); | |
| public String getTitle(); | |
| public String getDescription(); | |
| public String getRealFileName(); | |
| public Double getSize();//double? | |
| public void saveFile(File destination); | |
| } |
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
| for i in \"*\";do echo "$i"; mv "$i" "$(echo "$i" | tr -d \")";done; |
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
| 1 #include <Python.h> | |
| 2 #include <iostream> | |
| 3 #include "theano_mod_helper.h" | |
| 4 #include "cuda_ndarray.cuh" | |
| 5 ////////////////////// | |
| 6 //// Support Code | |
| 7 ////////////////////// | |
| 8 | |
| 9 | |
| 10 namespace { |
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
| from keras import backend as K | |
| if K.backend() == "tensorflow": | |
| print("Using tensorflow - try to use jit") | |
| import keras.backend.tensorflow_backend as bck | |
| config = bck.tf.ConfigProto() | |
| config.graph_options.optimizer_options.global_jit_level = bck.tf.OptimizerOptions.ON_1 | |
| bck.set_session(bck.tf.Session(config=config)) |
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
| '''Train a Siamese MLP on pairs of digits from the MNIST dataset. | |
| It follows Hadsell-et-al.'06 [1] by computing the Euclidean distance on the | |
| output of the shared network and by optimizing the contrastive loss (see paper | |
| for mode details). | |
| [1] "Dimensionality Reduction by Learning an Invariant Mapping" | |
| http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf | |
| Gets to 99.5% test accuracy after 20 epochs. |
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
| sudo apt-get install xvfb | |
| nohup Xvfb :1 > /dev/null 2>&1 & | |
| #testing with | |
| python | |
| import matplotlib | |
| import matplotlib.pyplot as plt |
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
| sudo apt-get install xvfb | |
| nohup Xvfb :1 > /dev/null 2>&1 & | |
| #testing with | |
| python | |
| import matplotlib | |
| import matplotlib.pyplot as plt |
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
| sudo apt-get install qt-sdk | |
| then follow | |
| #http://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html | |
| sudo apt-get install build-essential | |
| #install python header and includes | |
| # | |
| sudo apt-get install python2.7-dev | |
| sudo apt-get install python3.4-dev | |
| sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev |
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
| msg_locked_until = dateutil.parser.parse(msg.broker_properties['LockedUntilUtc']) | |
| if (datetime.now(utc) + timedelta(0, lock_buff_seconds)) > msg_locked_until: | |
| logger.info("Renewing message lock") | |
| try: | |
| msg.renew_lock() | |
| logger.info("Done.") | |
| except Exception as e: | |
| logger.error("Failed renewing the message lock.") | |
| logger.error(e.message) |
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
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import matplotlib.image as mpimg | |
| def do_something(img): | |
| return np.dot(img[...,:3], [0.299, 0.587, 0.114]) | |
| img = mpimg.imread('image.png') | |
| result = do_something(img) | |
| plt.imshow(result, cmap = plt.get_cmap('gray')) |