Skip to content

Instantly share code, notes, and snippets.

@keryil
keryil / layers_tied.py
Created July 16, 2018 22:00 — forked from dswah/layers_tied.py
Tied Convolutional Weights with Keras for CNN Auto-encoders
from keras import backend as K
from keras import activations, initializations, regularizers, constraints
from keras.engine import Layer, InputSpec
from keras.utils.np_utils import conv_output_length
from keras.layers import Convolution1D, Convolution2D
import tensorflow as tf
class Convolution1D_tied(Layer):
'''Convolution operator for filtering neighborhoods of one-dimensional inputs.
When using this layer as the first layer in a model,
@keryil
keryil / pyinstaller.log
Created May 18, 2017 17:59
Pyinstaller not finding cryptography hook #2525
This file has been truncated, but you can view the full file.
24 INFO: PyInstaller: 3.3.dev0+gc7a24e5
24 INFO: Python: 2.7.10
33 INFO: Platform: Darwin-15.6.0-x86_64-i386-64bit
34 INFO: wrote /Users/Kerem/Dropbox/ToyProjects/leaparticulator-mini/leaparticulatorqt/plotter_p2p.spec
34 DEBUG: Testing for UPX ...
42 INFO: UPX is not available.
43 DEBUG: script: /Users/Kerem/Dropbox/ToyProjects/leaparticulator-mini/leaparticulatorqt/leaparticulator/trajectory_plotter/plotter_p2p.py
44 INFO: Extending PYTHONPATH with paths
['/Users/Kerem/Dropbox/ToyProjects/leaparticulator-mini/leaparticulatorqt',
'/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages',
@keryil
keryil / brushless_programmer.ino
Created November 21, 2016 13:51
Arduino code that mimics an RF transmitter in order to program an ESC without one.
#include <Arduino.h>
#include <Servo.h>
static const int PROP_PIN = 9;
Servo brushless;
void setup() {
Serial.begin(9600);
brushless.attach(PROP_PIN);
@keryil
keryil / brushless_tester.ino
Last active November 21, 2016 13:24
Arduino code for driving a brushless ESC based on values received over the serial port.
#include <Arduino.h>
#include <Servo.h>
static const int PROP_PIN = 9;
Servo brushless;
void setup() {
Serial.begin(9600);
brushless.attach(PROP_PIN);
brushless.writeMicroseconds(0); //set initial value, check your manual