Skip to content

Instantly share code, notes, and snippets.

View sarath-menon's full-sized avatar
🎯
Focusing

Sarath S Menon sarath-menon

🎯
Focusing
View GitHub Profile

Code Bash command prefix detection

This defines risk levels for actions that the ${K4} agent may take. This classification system is part of a broader safety framework and is used to determine when additional user confirmation or oversight may be needed.

Command prefix extraction examples

Examples:

  • cat foo.txt => cat
  • cd src => cd
[
{
"id": 1,
"name": "Warehouse Drones",
"type_id": 1,
"description": "Autonomously navigate and scan barcodes in the warehouse, collecting item data and sensor readings."
},
{
"id": 2,
"name": "Inventory Management System (IMS)",
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
@sarath-menon
sarath-menon / pg-pong-python3
Created July 11, 2018 06:05
Just a python3 compatible version of Andrej Karpathy's code from excellent pong_RL blog post
import numpy as np
import pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
decay_rate = 0.99 # decay factor for RMSProp leaky sum of grad^2