Skip to content

Instantly share code, notes, and snippets.

View julian-ramos's full-sized avatar

Julian Ramos julian-ramos

View GitHub Profile
body {
font-size: 16px;
font-family: Helvetica;
background-color: aquamarine;
}
#instructors {
background-color: beige;
padding: 10px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="PUI/SSUI Lab Week 1" />
<title>Week 1</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
<link rel="shortcut icon" href="favicon.ico" />
#!/usr/bin/env python
# Python imports.
import sys
import logging
# Other imports.
import srl_example_setup
from simple_rl.agents import LinearQLearnerAgent, RandomAgent,QLearnerAgent
from simple_rl.tasks import GymMDP
@julian-ramos
julian-ramos / LinearQLearnerAgentClass.py
Created November 18, 2017 00:14
The modification was done on _phi (commented out the normalization) and _update_weights (making zero the Q(s',a) when s' is terminal)
'''
LinearQLearnerAgentClass.py
Contains implementation for a Q Learner with a Linear Function Approximator.
'''
# Python imports.
import numpy as np
import math
import numpy as np
import matplotlib.pylab as plt
from scipy.stats import skew
from scipy.stats import entropy
filename=["kmeans.meanshift.normalized.500.bandwidth.1.0.label.freq.csv",
"kmeans.meanshift.normalized.500.bandwidth.1.1.label.freq.csv",
"kmeans.meanshift.normalized.1000.bandwidth.1.1.label.freq.csv",
"kmeans.meanshift.normalized.1000.bandwidth.1.2.label.freq.csv"]
if __name__=="__main__":
# A=[[1,2,1,0],[3,1,0,1]]
# A=np.array(A)
#
# b=np.array([6,9])
# c=np.array([[-2],[-1],[0],[0]])
# I=np.array([2,3])
#
# print(simplex(I, c, A, b))
#
@julian-ramos
julian-ramos / SensorService.java
Created July 21, 2015 18:40
Code to have a foreground service recording accelerometer data at a sampling rate that is at least the one specified when the sensor is registered. This service restarts itself and also survives power saving modes. This was only tested on an android watch
public class SensorService extends Service implements SensorEventListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
// final Handler handler = new Handler();
private PowerManager pm;
private PowerManager.WakeLock wl;
GoogleApiClient googleClient;
String tail=".";
String recordingStrategy="";
int countDM=0;
boolean thread=false;