Skip to content

Instantly share code, notes, and snippets.

View phizaz's full-sized avatar
😀

Konpat phizaz

😀
View GitHub Profile
@phizaz
phizaz / keras_empty_layer.py
Created December 5, 2017 09:26
Keras Empty Layer
class MyLayer(Layer):
def __init__(self, **kwargs):
...
super(MyConv, self).__init__(**kwargs)
def build(self, input_shape):
...
super(MyConv, self).build(input_shape)
def call(self, x):
@phizaz
phizaz / Untitled.ipynb
Created October 23, 2017 16:42
Stackoverflow: Connecting two graphs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phizaz
phizaz / style.html
Created October 23, 2017 06:48
Ipython notebook html export css styles
<style type="text/css">
/*!
*
* Twitter Bootstrap
*
*/
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
@phizaz
phizaz / .bash_profile
Created September 28, 2017 15:47
Try to create a bash script for recursively building sources from arch linux repo for MSYS2
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# ~/.bash_profile: executed by bash(1) for login shells.
# The copy in your home directory (~/.bash_profile) is yours, please
@phizaz
phizaz / Dockerfile
Created July 19, 2017 04:40
Dockerfile - installing Jupyter extensions with VIM binding
# get needed for installing VIM binding
RUN apt-get update
RUN apt-get install -y git
# install Jupyter extensions (https://github.com/ipython-contrib/jupyter_contrib_nbextensions)
RUN pip install jupyter_contrib_nbextensions
RUN jupyter contrib nbextension install --user
# install VIM binding for Jupyter (https://github.com/lambdalisue/jupyter-vim-binding)
RUN mkdir -p $(jupyter --data-dir)/nbextensions \
@phizaz
phizaz / program.cs
Created June 21, 2017 10:59
C# Producer-Consumer Pattern with Timeout and Callback
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ProducerConsumer
{
@phizaz
phizaz / program.cs
Created June 21, 2017 10:50
C# Producer-Consumer Pattern with Timeout and Return Value
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ProducerConsumer
{
@phizaz
phizaz / program.cs
Created June 21, 2017 09:23
C# Producer-Consumer Pattern with Timeout
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ProducerConsumer
{
@phizaz
phizaz / talk.md
Created June 20, 2017 04:03
BKKMLMEETUP: Q-Learning for Trading

Q-Learning for algorithm trading

Q-Learning background

by Konpat

Q-Learninng is a reinforcement learning algorithm, Q-Learning does not require the model and the full understanding of the nature of its environment, in which it will learn by trail and errors, after which it will be better over time. And thus proved to be asymtotically optimal.

  • you need first to understand the Markov Decision Process, which is a graph consisting of (states, actions, rewards) denoting {S}, {A}, {R}
  • State (S)
@phizaz
phizaz / keybindings.json
Created February 24, 2017 14:25
VSCode Settings
// Place your key bindings in this file to overwrite the defaults
[{
"key": "ctrl+a",
"command": "editor.action.selectAll"
},
{
"key": "ctrl+x",
"command": "editor.action.clipboardCutAction"
},
{