Skip to content

Instantly share code, notes, and snippets.

View Engineero's full-sized avatar
🦙
:(){ : | :& };:

Nathan Engineero

🦙
:(){ : | :& };:
  • EngineeroLabs
  • USA
View GitHub Profile
@stephenway
stephenway / git-change-author-commit.sh
Created December 19, 2015 04:02
Change last commit author
git commit --amend --author "Stephen Way <way.stephen@gmail.com>" --no-edit && \
git rebase --continue
...
git push origin master --force
@mmmikael
mmmikael / mnist_siamese.py
Last active January 24, 2021 07:27
Keras example for siamese training on mnist
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
import random
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import *
from keras.optimizers import SGD, RMSprop
@gabrieleangeletti
gabrieleangeletti / autoencoder.py
Last active October 15, 2019 15:16
Denoising Autoencoder implementation using TensorFlow.
import tensorflow as tf
import numpy as np
import os
import zconfig
import utils
class DenoisingAutoencoder(object):
""" Implementation of Denoising Autoencoders using TensorFlow.
@danijar
danijar / blog_tensorflow_sequence_labelling.py
Last active January 12, 2024 15:18
TensorFlow Sequence Labelling
# Example for my blog post at:
# http://danijar.com/introduction-to-recurrent-networks-in-tensorflow/
import functools
import sets
import tensorflow as tf
def lazy_property(function):
attribute = '_' + function.__name__
@danijar
danijar / blog_tensorflow_variable_sequence_labelling.py
Last active May 15, 2022 14:28
TensorFlow Variable-Length Sequence Labelling
# Working example for my blog post at:
# http://danijar.com/variable-sequence-lengths-in-tensorflow/
import functools
import sets
import tensorflow as tf
from tensorflow.models.rnn import rnn_cell
from tensorflow.models.rnn import rnn
def lazy_property(function):
@jkleint
jkleint / timeseries_cnn.py
Created July 29, 2016 04:05
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
#!/usr/bin/env python
"""
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
"""
from __future__ import print_function, division
import numpy as np
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten
from keras.models import Sequential
@benwu232
benwu232 / tf_save.py
Created February 8, 2017 07:09
Describe how to use tensorflow to save model, parameters, inputs and outputs
import tensorflow as tf
tf.GraphKeys.USEFUL = 'useful'
v1 = tf.placeholder(tf.float32, name="v1")
v2 = tf.placeholder(tf.float32, name="v2")
v3 = tf.mul(v1, v2)
vx = tf.Variable(10.0, name="vx")
v4 = tf.add(v3, vx, name="v4")
@benwu232
benwu232 / tf_restore.py
Created February 8, 2017 07:11
Show how to restore model, parameters, inputs and outputs
import tensorflow as tf
tf.GraphKeys.USEFUL = 'useful'
saver = tf.train.import_meta_graph("./model_ex1.meta")
sess = tf.Session()
saver.restore(sess, "./model_ex1")
var_list = tf.get_collection(tf.GraphKeys.USEFUL)
v1 = var_list[0]
import csv
import hashlib
import re
import numpy as np
import tensorflow as tf
from PIL import Image
from tensorflow.python.util import compat
class DataHandler:
@abirkill
abirkill / visual_magnitude.py
Created July 26, 2018 00:15
Calculate the visual magnitude of a satellite (e.g. the ISS) using PyEphem
#!/usr/bin/env python
import ephem
import math
'''
Takes two PyEphem objects, one for the sun and one for the satellite, and the
satellite's standard magnitude value (-1.3 for the International Space Station),
and calculates the visual magnitude of the satellite.
'''
def calculate_visual_magnitude(sun, satellite, standard_magnitude):