Skip to content

Instantly share code, notes, and snippets.

View erfannoury's full-sized avatar

Erfan Noury erfannoury

View GitHub Profile
@twiecki
twiecki / bayesian_neural_network.ipynb
Last active August 30, 2025 08:45
Bayesian Neural Network in PyMC3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kastnerkyle
kastnerkyle / mscoco_dataset.py
Last active July 27, 2016 15:19
MSCOCO threaded iterator/reader
# Authors: Kyle Kastner, Francesco Visin
# License: BSD 3-Clause
try:
import Queue
except ImportError:
import queue as Queue
import threading
import time
from matplotlib.path import Path
from PIL import Image
@kastnerkyle
kastnerkyle / threaded_image_reader.py
Last active December 15, 2019 12:28
Threaded image reader in Python
# Author: Kyle Kastner
# License: BSD 3-Clause
# For a reference on parallel processing in Python see tutorial by David Beazley
# http://www.slideshare.net/dabeaz/an-introduction-to-python-concurrency
# Loosely based on IBM example
# http://www.ibm.com/developerworks/aix/library/au-threadingpython/
try:
import Queue
except ImportError:
import queue as Queue
@bishboria
bishboria / springer-free-maths-books.md
Last active September 25, 2025 06:28
Springer made a bunch of books available for free, these were the direct links
@bartvm
bartvm / dl-frameworks.rst
Last active December 7, 2020 18:18
A comparison of deep learning frameworks

A comparison of Theano with other deep learning frameworks, highlighting a series of low-level design choices in no particular order.

Overview

Symbolic: Theano, CGT; Automatic: Torch, MXNet

Symbolic and automatic differentiation are often confused or used interchangeably, although their implementations are significantly different.

@baraldilorenzo
baraldilorenzo / readme.md
Last active September 13, 2025 12:17
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

String interpolation

var x = 1;

// same as string.Format("A {0} B", x) 
var y1 = $"A {x} B"; // y == "A 1 B"

// $@ for multiline
var y2 = $@"A
@foxxjnm
foxxjnm / Blur.cs
Created February 16, 2015 15:58
Xamarin.iOS Image Blur
public static UIImage Blur(this UIImage image, float blurRadius = 25f)
{
if (image != null)
{
// Create a new blurred image.
var imageToBlur = new CIImage (image);
var blur = new CIGaussianBlur ();
blur.Image = imageToBlur;
blur.Radius = blurRadius;
@Kenneth-Posey
Kenneth-Posey / gist:ca73d54e23d294546fa0
Created September 23, 2014 22:39
F# Image-Finder
namespace FsharpImaging
open System
open System.Drawing
open System.Drawing.Imaging
open System.Runtime.InteropServices
module ArrayFunctions =
// Generic because it makes testing easier, yay math
let IsSubMatrix (smallArray:'a[][]) (largeArray:'a[][]) (startCoordinate:(int * int)) =
@alexland
alexland / serialize-numpy-array.py
Last active November 28, 2023 07:12
serialize, persist, retrieve, and de-serialize a NumPy array as a binary string (any dimension, any dtype); exemplary use case: a web app calculates some result--eg, from a Machine Learning algorithm, using NumPy and the result is a NumPy array; it is efficient to just return that result to rather than persist the array then retrieve it via query
import time
import numpy as NP
from redis import StrictRedis as redis
# a 2D array to serialize
A = 10 * NP.random.randn(10000).reshape(1000, 10)
# flatten the 2D NumPy array and save it as a binary string
array_dtype = str(A.dtype)