Skip to content

Instantly share code, notes, and snippets.

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

Nathan Engineero

🦙
:(){ : | :& };:
  • EngineeroLabs
  • USA
View GitHub Profile
@Chris-hughes10
Chris-hughes10 / EfficientDet Pytorch-lightning with EfficientNet v2 backbone Blog Post.ipynb
Last active April 22, 2024 08:57
EfficientDet Pytorch-lightning with EfficientNet v2 backbone Blog Post.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from tensorflow.python.eager import def_function
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import tensor_shape
from tensorflow.python.keras import backend as K
from tensorflow.python.keras import layers
from tensorflow.python.keras import initializers
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
class SpectralNormalization(layers.Wrapper):
@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):
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:
@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]
@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")
@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
@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):
@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__
@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.