Skip to content

Instantly share code, notes, and snippets.

View nailo2c's full-sized avatar

Aaron Chen nailo2c

View GitHub Profile
import random
random.seed(5566)
def random_shuffle(band_list):
for _ in range(100):
random.shuffle(band_list)
return
first = ['Out the Door', 'Socrates']
second = ['Weekly Report', '趨程勢']
@nailo2c
nailo2c / elasticsearch-retrieve-all-data.py
Created January 8, 2019 10:22
Use ElasticSearch python api to retrieve all data
from elasticsearch import Elasticsearch
from elasticsearch import helpers
es_url = 'https://your/elasticsearch/url/'
index = '*your-index*'
query = {
"query": {
"match_all": {}
}
}
@nailo2c
nailo2c / pytorch-policy-gradient.py
Last active March 25, 2019 08:27
Implement policy gradient by PyTorch and training on ATARI Pong
# -*- coding: utf-8 -*-
import os
import argparse
import gym
import numpy as np
from itertools import count
import torch
import torch.nn as nn