if you are using linux, unix, os x:
pip install -U setuptools
pip install -U pip
pip install numpy
pip install scipy
pip install matplotlib
#pip install PySide
#ifndef FIBONACCI_HEAP_H_ | |
#define FIBONACCI_HEAP_H_ | |
#include <memory> | |
#include <list> | |
#include <functional> | |
#include <algorithm> | |
#include <limits> | |
#include <cmath> | |
#include <vector> |
#ifndef BINOMIAL_HEAP_H_ | |
#define BINOMIAL_HEAP_H_ | |
#include <memory> | |
#include <list> | |
#include <functional> | |
#include <algorithm> | |
#include <limits> | |
template <class K, class V, class Compare = std::less<K>> // K - key, V - additional data |
if you are using linux, unix, os x:
pip install -U setuptools
pip install -U pip
pip install numpy
pip install scipy
pip install matplotlib
#pip install PySide
Want to move computation on machine with much power. We will set up Anaconda 4.0.0 and XGBoost 0.4 (it is tricky installable).
import pandas as pd | |
from sklearn.feature_extraction.text import CountVectorizer | |
import logging | |
class BagOfWordsModel(object): | |
OUT_FOLDER = 'out' | |
def __init__(self, id_document_dict, max_features=None, max_df=1.0): | |
"""Builds bow model. |
import gym | |
import numpy as np | |
DISCOUNT = 1.0 | |
STEP_REWARD = 0.0 | |
LOSE_REWARD = 0.0 | |
WIN_REWARD = 1.0 | |
def avg_reward(env, s, a): | |
avg_reward = 0 |
# Optionally, you could now dump the network weights to a file like this: | |
np.savez('model.npz', *lasagne.layers.get_all_param_values(network)) | |
# | |
# And load them again later on like this: | |
with np.load('model.npz') as f: | |
param_values = [f['arr_%d' % i] for i in range(len(f.files))] | |
lasagne.layers.set_all_param_values(network, param_values) |