Skip to content

Instantly share code, notes, and snippets.

View marty1885's full-sized avatar
πŸ‘¨β€πŸ’»
Writing code

Martin Chang marty1885

πŸ‘¨β€πŸ’»
Writing code
View GitHub Profile
from etaler import et
import gym
env = gym.make('FrozenLake-v0', is_slippery=False)
# The agent is very simple. Mathmetically, think it as a weaker Q table. Biologically, it is a bunch
# of perimedial neurons receving input signals and direcly connected to a motor. Then the reward is
# used for modifing the behaivor of the neurons.
class Agent:
def __init__(self):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <string>
#include <iostream>
#include <iomanip>
#include <random>
#include <openssl/sha.h>
inline std::string sha256(const std::string str)
{
unsigned char hash[SHA256_DIGEST_LENGTH+1];
#include <vector>
#include <algorithm>
#include <chrono>
#include <random>
#include <cstdint>
#include <cassert>
// Banchmarking library
#include <hayai/hayai.hpp>
#include <vector>
#include <algorithm>
#include <chrono>
#include <random>
#include <cstdint>
#include <cassert>
// Banchmarking library
#include <hayai/hayai.hpp>
#include <fstream>
#include <tuple>
#include <vector>
#include <iostream>
int main()
{
using vec2d = std::tuple<float, float>;
std::ifstream in("input.txt");
float x, y;
@marty1885
marty1885 / c1.cpp
Last active November 16, 2019 02:58
HTM hyper parameter plot generated by ROOT
void c1()
{
//=========Macro generated from canvas: c1/Canvas
//========= (Sat Nov 16 10:57:34 2019) by ROOT version 6.18/04
gStyle->SetCanvasPreferGL(kTRUE);
TCanvas *c1 = new TCanvas("c1", "Canvas",10,570,700,500);
gStyle->SetOptStat(0);
c1->Range(-1.006644,-1.180079,1.006644,1.180079);
#include <Etaler/Etaler.hpp>
#include <Etaler/Backends/CPUBackend.hpp>
//#include <Etaler/Backends/OpenCLBackend.hpp>
#include <Etaler/Algorithms/TemporalMemory.hpp>
#include <Etaler/Encoders/Scalar.hpp>
using namespace et;
#include <vector>
#include <chrono>
#include <random>