Skip to content

Instantly share code, notes, and snippets.

View abhayraw1's full-sized avatar

Abhay Rawat abhayraw1

View GitHub Profile
@abhayraw1
abhayraw1 / Readme.md
Last active March 16, 2018 09:18
Conway's Game of Life Python 3 implementation.

Conway's Game of Life

Running the script
python3 game_of_life.py game_of_life.json
Running different configurations

There area number of different starting configurations to choose from in the configuration file: game_of_life.json You can specify any starting configurations given in the file by changing the value of the "Preset" key

@abhayraw1
abhayraw1 / simple_fcnn.py
Last active April 17, 2019 06:46
Simple Feed Forward Neural Net Using tf.keras written for reproducing issue #27316 mentioned in tensorflow/issues
import numpy as np
import tensorflow as tf
import tensorflow.keras.layers as L
import tensorflow.keras.activations as Z
from tensorflow.keras import Model
from pprint import pprint
def feed_forward_nn(input_shape):
with tf.variable_scope("keras_"):
import sys, code, traceback, pdb
from contextlib import contextmanager
""" Context Manager for launching pdb interactive right at the point of failure.
Mixed and matched from:
[1]: ieure/error_debug.py [https://gist.github.com/ieure/193277]
[2]: Florian Bosch's answer on SO [https://stackoverflow.com/questions/242485/starting-python-debugger-automatically-on-error]
"""
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import numpy as np
sequence_length = 10
print(sequence_length)
class Net(nn.Module):
@abhayraw1
abhayraw1 / gendata.py
Last active April 24, 2020 16:15
Generate Image Dataset of Pendulum-v0
import gym
import pdb
import pickle
import argparse
from utils import *
from memory import *
BIT_DEPTH = 5
@abhayraw1
abhayraw1 / ShowMousePosition.cs
Last active May 31, 2020 22:03
TeleOperation (using mouse) Plugin for RosSharp. Add to the RosConnector Object. Inputs are the topic name, camera, a prefab for pointer and the base link of the robot.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ShowMousePosition : MonoBehaviour
{
public GameObject mousePointer;
public bool clipToInteger;
public Camera cam;
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# test/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
Making all in Ipopt
make[1]: Entering directory '/home/abhay/Ipopt/Ipopt'
Making all in src/Common
make[2]: Entering directory '/home/abhay/Ipopt/Ipopt/src/Common'
make all-am
make[3]: Entering directory '/home/abhay/Ipopt/Ipopt/src/Common'
make[3]: Leaving directory '/home/abhay/Ipopt/Ipopt/src/Common'
make[2]: Leaving directory '/home/abhay/Ipopt/Ipopt/src/Common'
Making all in src/LinAlg
make[2]: Entering directory '/home/abhay/Ipopt/Ipopt/src/LinAlg'
Making all in Ipopt
make[1]: Entering directory '/home/abhay/Ipopt/Ipopt'
Making all in src/Common
make[2]: Entering directory '/home/abhay/Ipopt/Ipopt/src/Common'
make all-am
make[3]: Entering directory '/home/abhay/Ipopt/Ipopt/src/Common'
make[3]: Leaving directory '/home/abhay/Ipopt/Ipopt/src/Common'
make[2]: Leaving directory '/home/abhay/Ipopt/Ipopt/src/Common'
Making all in src/LinAlg
make[2]: Entering directory '/home/abhay/Ipopt/Ipopt/src/LinAlg'
Making all in Ipopt
make[1]: Entering directory '/home/abhay/Ipopt/Ipopt'
Making all in src/Common
make[2]: Entering directory '/home/abhay/Ipopt/Ipopt/src/Common'
make all-am
make[3]: Entering directory '/home/abhay/Ipopt/Ipopt/src/Common'
make[3]: Leaving directory '/home/abhay/Ipopt/Ipopt/src/Common'
make[2]: Leaving directory '/home/abhay/Ipopt/Ipopt/src/Common'
Making all in src/LinAlg
make[2]: Entering directory '/home/abhay/Ipopt/Ipopt/src/LinAlg'