Skip to content

Instantly share code, notes, and snippets.

Avatar

Dennis Richardson 4SkyNet

View GitHub Profile
@4SkyNet
4SkyNet / BFOA.py
Created Dec 14, 2018 — forked from x0xMaximus/BFOA.py
Bacterial Foraging Optimization Algorithm
View BFOA.py
# Bacterial Foraging Optimization Algorithm
# (c) Copyright 2013 Max Nanis [max@maxnanis.com].
import os, random, math, csv
class BFOA():
def __init__(self, pop_size = 100, problem_size = 2, dimension = [-1, 1], elim_disp_steps = 1, repro_steps = 4, chem_steps = 30):
self.step_index = 0
self.run_id = os.urandom(6).encode('hex')
View monte_carlo.py
# https://github.com/tensorflow/probability/blob/master/tensorflow_probability/python/monte_carlo.py
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@4SkyNet
4SkyNet / libimobiledevice_ifuse_Ubuntu.md
Created Nov 24, 2017 — forked from samrocketman/libimobiledevice_ifuse_Ubuntu.md
On Ubuntu 16.04, since iOS 10 update, libimobiledevice can't connect to my iPhone. This is my attempt to document a fix.
View libimobiledevice_ifuse_Ubuntu.md

Why this document?

I upgraded my iPhone 5s to iOS 10 and could no longer retrieve photos from it. This was unacceptable for me so I worked at achieving retrieving my photos. This document is my story (on Ubuntu 16.04).

The solution is to compile libimobiledevice and ifuse from source.

Audience

Who is this guide intended for?

@4SkyNet
4SkyNet / notebook.ipynb
Created Jul 17, 2017 — forked from eamartin/notebook.ipynb
Understanding & Visualizing Self-Normalizing Neural Networks
View notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View model.py
import numpy as np
import theano
import theano.tensor as T
import lasagne
from collections import OrderedDict
def get_adam_steps_and_updates(all_grads, params, learning_rate=0.001,
beta1=0.9, beta2=0.999, epsilon=1e-8):
t_prev = theano.shared(lasagne.utils.floatX(0.))
@4SkyNet
4SkyNet / tf_codestyle.md
Last active Aug 31, 2020
TensorFlow Code Style
View tf_codestyle.md

1. Python style

Generally follow PEP8 Python style guide

But! Try to use Tensorflow wherever it useful (or possible...)

2. Tensors

  • Operations that deal with batches may assume that the first dimension of a Tensor is the batch dimension.
@4SkyNet
4SkyNet / tf_lstm.py
Created Oct 4, 2016 — forked from siemanko/tf_lstm.py
Simple implementation of LSTM in Tensorflow in 50 lines (+ 130 lines of data generation and comments)
View tf_lstm.py
"""Short and sweet LSTM implementation in Tensorflow.
Motivation:
When Tensorflow was released, adding RNNs was a bit of a hack - it required
building separate graphs for every number of timesteps and was a bit obscure
to use. Since then TF devs added things like `dynamic_rnn`, `scan` and `map_fn`.
Currently the APIs are decent, but all the tutorials that I am aware of are not
making the best use of the new APIs.
Advantages of this implementation:
You can’t perform that action at this time.