Skip to content

Instantly share code, notes, and snippets.

M. Ernestus erniejunior

Block or report user

Report or block erniejunior

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
@erniejunior
erniejunior / elastic_transform.py
Last active Dec 11, 2019 — forked from fmder/elastic_transform.py
Elastic transformation of an image in Python
View elastic_transform.py
import numpy as np
from scipy.ndimage.interpolation import map_coordinates
from scipy.ndimage.filters import gaussian_filter
def elastic_transform(image, alpha, sigma, random_state=None):
"""Elastic deformation of images as described in [Simard2003]_.
.. [Simard2003] Simard, Steinkraus and Platt, "Best Practices for
Convolutional Neural Networks applied to Visual Document Analysis", in
Proc. of the International Conference on Document Analysis and
Recognition, 2003.
@erniejunior
erniejunior / episode_generation.py
Created Jul 5, 2019
An efficient way of generating a large number of trajectories for a QuadrotorEnvironment
View episode_generation.py
import time
import numpy as np
from quadrotor_environment.quadrotor_model import SysState
from quadrotor_environment.simulation_parameter_randomization import SPRWrappedQuadrotorEnvironment
from stable_baselines import PPO2
state_dtype = np.dtype([("position", np.float, 3),
("velocity", np.float, 3),
("rotation", np.quaternion),
@erniejunior
erniejunior / pip freeze output
Created Feb 11, 2019
pip3 freeze 11.2.2019
View pip freeze output
absl-py==0.6.1
alabaster==0.7.10
AnyQt==0.0.8
apptools==4.4.0
apt-clone==0.2.1
apt-xapian-index==0.47
apturl==0.5.2
astor==0.7.1
atari-py==0.1.6
atomicwrites==1.2.1
View inverted_slides.py
# -*- coding: utf-8 -*-
import math
import re
import time
def extractTerms(document):
'''
Extracts all the terms (lowercased) from a document string.
'''
return [t.lower() for t in re.split("\W+", document)]
@erniejunior
erniejunior / Control Continous Servo with 2 Pots
Last active Dec 24, 2015
The pot at the speed pot pin determines the overall speed (forwards and backwards might be asymmetric! The pot at the direction pot pin determines the direction. * all the way down: full speed backward * down: backwards * middle: stop * up: forwards * all the way up: full speed forward
View Control Continous Servo with 2 Pots
#include <Servo.h>
int servoPin = 9, speedPotPin = A0, directionPotPin = A1;
Servo servo;
void setup()
{
Serial.begin(9600);
pinMode(servoPin, OUTPUT);
pinMode(speedPotPin, INPUT);
pinMode(directionPotPin, INPUT);
@erniejunior
erniejunior / MaximalSumSubsequence.py
Created Oct 28, 2015
Linear Time Divide and Conquer Maximal Sum Subsequence Algorithm
View MaximalSumSubsequence.py
# -*- coding: utf-8 -*-
import random
'''
ACTUAL ALGORITHM START
'''
def getMaximumSumSubsequenceInformation(sequence, start, end):
'''
Returns information regarding the subsequence with maximal sum in the given
You can’t perform that action at this time.