Skip to content

Instantly share code, notes, and snippets.

yassersouri / dtft.m
Created November 27, 2012 13:05
DTFT in matlab
View dtft.m
function [ X ] = dtft( x, n, w )
% [X] = dtft(x, n, w)
% X = DTFT values computed at w frequencies
% x = finite duration sequence over n
% n = sample position vector
% w = frequency location vector
temp = w' * n;
temp = -1i * temp;
yassersouri / Assignments Latex
Last active November 8, 2021 03:46
Assignments Latex template.
View Assignments Latex

##Assignments Latex Template

###V 0.1

I always wanted some latex template that I could use for assignments. But none of the templates I found online had all the features I wanted. So the natural next step for me was to create one.


  • Use with XeLaTeX
yassersouri /
Created February 19, 2018 22:35
PyTorch Sampler for Intensional Overfitting!
from import Sampler
class MySampler(Sampler):
def __init__(self, main_source, indices):
self.main_source = main_source
self.indices = indices
main_source_len = len(self.main_source)
how_many = int(round(main_source_len / len(self.indices)))
yassersouri / How to visualize the ILSVRC mean
Last active September 6, 2016 20:57
How to visualize the ILSVRC mean image
View How to visualize the ILSVRC mean

I had an issue with how to visualize the ILSVRC mean image. I just wanted to look at it and see how much does it differ from using pixel-wise mean subtraction instead of image-wise mean subtraction.

I assume that you have already downloaded the CaffeNet pretrained and model definition files.

The trick is to initialize two networks, one with mean file set (called net_mean) and the other one without mean file (called net). Then create a fake all 1 image. Use the net_mean to preprocess the fake image for data layer and save the result as fake_pre. Then use the net to deprocess fake_pre for data layer and save it as fake_re. If the two networks net and net_mean were the same then fake_re would be equal to fake, but since we have not set any mean file for net then we can visualize the mean image using 1 - fake_re. Take a look at the code.

The result looks like this:

![ILSVRC mean image](

yassersouri / flare.json
Last active December 18, 2015 14:19 — forked from mbostock/.block
View flare.json
"name": "flare",
"children": [
"name": "analytics",
"children": [
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

yassersouri / Default (OSX).sublime-keymap
Created March 14, 2013 06:03 — forked from idan/Default (OSX).sublime-keymap
add the 1-2 layout to sublime text. Add these files with these file names to /Users/$ACCOUNTNAME$/Library/Application\ Support/Sublime\ Text\ 3/Packages/User
View Default (OSX).sublime-keymap
"keys": ["super+alt+shift+5"],
"command": "set_layout",
"caption" : "1-2 Grid",
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.5, 1.0],
yassersouri /
Created February 15, 2013 11:19
`~/.matlab/R2012a/` for Mac OS X 10.8 with homebrew. via <>
# Shell script for configuring MEX-file creation script,
# mex. These options were tested with the specified compiler.
# usage: Do not call this file directly; it is sourced by the
# mex shell script. Modify only if you don't like the
# defaults after running mex. No spaces are allowed
# around the '=' in the variable assignment.
# Note: For the version of system compiler supported with this release,
yassersouri / gist:4959407
Last active December 13, 2015 18:58
View gist:4959407
# git aliases
alias gs='git status'
alias gl="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
alias gpom='git push origin master'
alias gpo='git push origin'
alias gp='git push'
alias glom='git pull origin master'
alias glo='git pull origin'
alias gm='git commit -m'
alias gma='git commit -am'
yassersouri /
Created December 2, 2015 11:48 — forked from SNagappan/


This is an implementation of Facebook's baseline GRU/LSTM model on the bAbI dataset Weston et al. 2015. It includes an interactive demo.

The bAbI dataset contains 20 different question answering tasks.

Model script

The model training script and demo script are included below.