Skip to content

Instantly share code, notes, and snippets.

Yasser Souri yassersouri

Block or report user

Report or block yassersouri

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yassersouri
yassersouri / sampler.py
Created Feb 19, 2018
PyTorch Sampler for Intensional Overfitting!
View sampler.py
from torch.utils.data.sampler 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)))
View README.md

##Model

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 train.py and demo script demo.py are included below.

Instructions

@yassersouri
yassersouri / add_monitor_resolution.sh
Created Feb 13, 2015
Add new monitor resolution to ubuntu
View add_monitor_resolution.sh
# change 1280*768 to what ever your monitor and computer must support but does not!
cvt 1280 768 60
# 1280x768 59.87 Hz (CVT) hsync: 47.78 kHz; pclk: 79.50 MHz
# Modeline "1280x768_60.00" 79.50 1280 1344 1472 1664 768 771 781 798 -hsync +vsync
# change based on what was printed after the previous command
xrandr --newmode "1280x768_60.00" 79.50 1280 1344 1472 1664 768 771 781 798 -hsync +vsync
xrandr --addmode VGA1 "1280x768_60.00"
@yassersouri
yassersouri / How to visualize the ILSVRC mean image.md
Last active Sep 6, 2016
How to visualize the ILSVRC mean image
View How to visualize the ILSVRC mean image.md

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](https://gist.github.com/yassersouri/f617bf7eff9172290b4f/raw/863971c47470204234017b91196b5e94a6fe

View set_up_opencv_on_mac.md

###Download XCode from the App Store Get it from here

###Get cmake Use/get a package manager, such as homebrew. Open a terminal window and type the following

brew install cmake

This will get the required packages for cmake.

@yassersouri
yassersouri / Assignments Latex Template.md
Last active Apr 14, 2020
Assignments Latex template.
View Assignments Latex Template.md

##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.

###Notes:

  • Use with XeLaTeX
View flare.json
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
View pr.md

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 = git@github.com:joyent/node.git

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
yassersouri / Default (OSX).sublime-keymap
Created Mar 14, 2013 — 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",
"args":
{
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells":
@yassersouri
yassersouri / mexopts.sh
Created Feb 15, 2013
`~/.matlab/R2012a/mexopts.sh` for Mac OS X 10.8 with homebrew. via <http://bastibe.de/matlab-mex-homebrew-and-os-x-108-mountain-lion.html>
View mexopts.sh
#
# mexopts.sh 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,
You can’t perform that action at this time.