Skip to content

Instantly share code, notes, and snippets.

View pratikac's full-sized avatar

Pratik Chaudhari pratikac

View GitHub Profile
class View(nn.Module):
def __init__(self,o):
super().__init__()
self.o = o
def forward(self,x):
return x.view(-1, self.o)
class allcnn_t(nn.Module):
def __init__(self, c1=96, c2= 192):
@pratikac
pratikac / clean-lcm-libbot.sh
Last active August 29, 2015 14:28
Clean LCM and libbot installations in /usr/local
#!/bin/bash
# echo everything!
set -x
# bin
sudo rm -rf /usr/local/bin/bot-*
sudo rm -rf /usr/local/bin/lcm-*
# libs
require 'torch'
require 'nn'
use_cpu = true
require('fakecuda').init(use_cpu)
require 'cutorch'
a = torch.randn(10)
a:cuda()
function get_model()
local m = nn:Sequential()
m:add(cudnn.SpatialConvolution(1, 32, 5, 5))
m:add(cudnn.ReLU(true))
m:add(cudnn.SpatialMaxPooling(3,3,3,3))
m:add(cudnn.SpatialConvolution(32, 64, 5, 5))
m:add(cudnn.ReLU(true))
m:add(cudnn.SpatialMaxPooling(2,2,2,2))
@pratikac
pratikac / RRT.m
Last active August 29, 2015 14:21
Some vanilla RRT code in MATLAB (mostly to see how slow MATLAB is...)
function[] = RRT()
clear all;clc; clf;
tree = [];
buildRRT();
%plot(tree.x,tree.y,'ro-');
%plot_tree(tree)
function [] = plotTree(tree)
for i=1:length(tree),
n = tree(1);
@pratikac
pratikac / rrt.py
Last active August 29, 2015 14:21
Steve Lavalle's RRT code (stripped off pygame)
import sys, random, math
from math import sqrt,cos,sin,atan2
#constants
xdim = 640
ydim = 480
winsize = [xdim, ydim]
epsilon = 10.0
num_nodes = 1000
goal = (300, 400)