Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kashif's full-sized avatar

Kashif Rasul kashif

  • Berlin, Germany
  • 14:57 (UTC +02:00)
  • X @krasul
View GitHub Profile
@kashif
kashif / evonorm2d.py
Last active April 10, 2020 22:40
EvoNorm-S0 in PyTorch from https://arxiv.org/pdf/2004.02967.pdf
import torch
import torch.nn as nn
class EvoNorm2d(nn.Module):
__constants__ = ['num_features', 'eps', 'nonlinearity']
def __init__(self, num_features, eps=1e-5, nonlinearity=True):
super(EvoNorm2d, self).__init__()
@kashif
kashif / geodatabases.md
Created May 27, 2011 10:09
GeoDatabases - a discussion

GeoDatabases

What is a GeoDatabase? and how is it diff from a regular db

  • Stores geometries
  • multi-dimensional
  • R-Tree indexing (Query planner uses it?)
  • projections
  • Supports Datums ?
  • Vector and raster support
@kashif
kashif / amsgrad.py
Last active May 13, 2019 14:21
Keras implementation of AMSGrad optimizer from "On the Convergence of Adam and Beyond" paper
class AMSgrad(Optimizer):
"""AMSGrad optimizer.
Default parameters follow those provided in the Adam paper.
# Arguments
lr: float >= 0. Learning rate.
beta_1: float, 0 < beta < 1. Generally close to 1.
beta_2: float, 0 < beta < 1. Generally close to 1.
epsilon: float >= 0. Fuzz factor.
@kashif
kashif / input_fn.py
Last active March 2, 2019 16:42
TensorFlow 1.x Estimator input pipeline function to read images organised in their class folders
def input_fn(file_pattern, labels,
image_size=(224,224),
shuffle=False,
batch_size=64,
num_epochs=None,
buffer_size=4096,
prefetch_buffer_size=None):
table = tf.contrib.lookup.index_table_from_tensor(mapping=tf.constant(labels))
num_classes = len(labels)
@kashif
kashif / ubuntu-11.10-gems.erb
Created October 10, 2011 11:58 — forked from bensie/chef_bootstrap_rvm.erb
Chef bootstrap With rvm and ruby 1.9.3 on ubuntu 11.10
bash -c '
<% if knife_config[:bootstrap_proxy] -%>
(
cat <<'EOP'
<%= "proxy = #{knife_config[:bootstrap_proxy]}" %>
EOP
) > ~/.curlrc
<% end -%>
if [ ! -f /usr/bin/chef-client ]; then
@kashif
kashif / acc_sgd.py
Created March 16, 2018 11:32
AccSGD optimizer for keras
class AccSGD(Optimizer):
"""AccSGD optimizer.
Arguments:
lr (float): learning rate
kappa (float, optional): ratio of long to short step (default: 1000)
xi (float, optional): statistical advantage parameter (default: 10)
smallConst (float, optional): any value <=1 (default: 0.7)
# References
@kashif
kashif / es.py
Last active June 5, 2017 12:07
Initial implementation of Evolution Strategies
import numpy as np
import gym
from gym.spaces import Discrete, Box
from gym.wrappers import Monitor
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten
# ================================================================
# Policies
name: "autocolorize"
input: "data"
input_dim: 1
input_dim: 1
input_dim: 514
input_dim: 514
layer {
name: "data"
type: "Input"
top: "data"
@kashif
kashif / Softwareprojekte.md
Created February 26, 2013 20:57
Softwareprojekte for SpacialDB
  • a short description of your company and what you do/offer
  • a detailed description of the students tasks/project
  • requirements (knowledge of, e. g. Spatial DB course, programming skills)
  • task/project plans (what will they do?)
  • what are the students going to work with/learn:
  • programming languages
  • infrastructure (versioning system, build system)
@kashif
kashif / gist:1724880
Created February 2, 2012 18:00
unix bench
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: europe.spacialdb.com: GNU/Linux
OS: GNU/Linux -- 3.0.0-12-server -- #20-Ubuntu SMP Fri Oct 7 16:36:30 UTC 2011
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz (5346.4 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 1: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz (5346.4 bogomips)