http://vermandel.fr/fr/dsge-dynare-model-matlab-codes/
http://www.chadfulton.com/posts/estimating_rbc.html
https://pythonhosted.org/pymaclab/#series-of-brief-tutorials
| import pandas as pd | |
| from collections import Counter | |
| import tensorflow as tf | |
| from tffm import TFFMRegressor | |
| from sklearn.metrics import mean_squared_error | |
| from sklearn.model_selection import train_test_split | |
| import numpy as np | |
| # Loading datasets' |
| # Get all POST and GET requests using tshark | |
| tshark -i en0 -f'port 80 and (tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504F5354 or tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420)' -w ~/out.ncap | |
| tcpdump -qns 0 -A -r /var/root/out.ncap | less |
| """ | |
| Implementations of: | |
| Probabilistic Matrix Factorization (PMF) [1], | |
| Bayesian PMF (BPMF) [2], | |
| Modified BPFM (mBPMF) | |
| using `pymc3`. mBPMF is, to my knowledge, my own creation. It is an attempt | |
| to circumvent the limitations of `pymc3` w/regards to the Wishart distribution: |
| class StackedEnsembleClassifier(sklearn.base.BaseEstimator, sklearn.base.ClassifierMixin): | |
| """ | |
| Ensemble of classifiers. Each classifier must have predict_proba and the head classifier is trained | |
| to predict the output based on the individual classifier outputs. Stratified k-fold cross-validation | |
| is used to get probabilities on held-out data. | |
| """ | |
| def __init__(self, classifiers, head_classifier, num_folds=3): | |
| self.classifiers = classifiers | |
| self.head_classifier = head_classifier | |
| self.num_folds = num_folds |
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Mon Aug 22 00:36:48 2016 | |
| @author: park | |
| """ | |
| #%% train | |
| import theano |
##VGG16 model for Keras
This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.
It has been obtained by directly converting the Caffe model provived by the authors.
Details about the network architecture can be found in the following arXiv paper:
Very Deep Convolutional Networks for Large-Scale Image Recognition
K. Simonyan, A. Zisserman
| import numpy as np | |
| from scipy.ndimage.interpolation import map_coordinates | |
| from scipy.ndimage.filters import gaussian_filter | |
| def elastic_transform(image, alpha, sigma, random_state=None): | |
| """Elastic deformation of images as described in [Simard2003]_. | |
| .. [Simard2003] Simard, Steinkraus and Platt, "Best Practices for | |
| Convolutional Neural Networks applied to Visual Document Analysis", in |