Skip to content

Instantly share code, notes, and snippets.

@4SkyNet
4SkyNet / BFOA.py
Created December 14, 2018 16:17 — forked from x0xMaximus/BFOA.py
Bacterial Foraging Optimization Algorithm
# 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')
@4SkyNet
4SkyNet / libimobiledevice_ifuse_Ubuntu.md
Created November 24, 2017 13:23 — 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.

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 July 17, 2017 22:50 — forked from eamartin/notebook.ipynb
Understanding & Visualizing Self-Normalizing Neural Networks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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_lstm.py
Created October 4, 2016 11:45 — forked from siemanko/tf_lstm.py
Simple implementation of LSTM in Tensorflow in 50 lines (+ 130 lines of data generation and comments)
"""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: