Skip to content

Instantly share code, notes, and snippets.

View fsodogandji's full-sized avatar

Fabrice Sodogandji fsodogandji

View GitHub Profile
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'
@fsodogandji
fsodogandji / get_POST_get_tshark.sh
Created December 8, 2016 10:53
tshark wireshark tcpdump POST GET
# 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
@fsodogandji
fsodogandji / pmf-and-modified-bpmf-pymc.py
Created October 28, 2016 03:35 — forked from macks22/pmf-and-modified-bpmf-pymc.py
Probabilistic Matrix Factorization (PMF) + Modified Bayesian BMF
"""
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:
@fsodogandji
fsodogandji / stacked_ensemble.py
Created October 3, 2016 09:26 — forked from ktrnka/stacked_ensemble.py
Stacked ensemble of classifiers compatible with scikit-learn
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
@fsodogandji
fsodogandji / mdn_demo_theano.py
Created September 10, 2016 10:06 — forked from daniel-geon-park/mdn_demo_theano.py
Mixture Density Network(MDN) implemenation in Theano
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 22 00:36:48 2016
@author: park
"""
#%% train
import theano
@fsodogandji
fsodogandji / readme.md
Created September 1, 2016 23:14 — forked from baraldilorenzo/readme.md
VGG-16 pre-trained model for Keras

##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

@fsodogandji
fsodogandji / elastic_transform.py
Created August 11, 2016 10:54 — forked from chsasank/elastic_transform.py
Elastic transformation of an image in Python
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
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.