Skip to content

Instantly share code, notes, and snippets.

View cbaziotis's full-sized avatar

Christos Baziotis cbaziotis

View GitHub Profile
@filitchp
filitchp / OpenCV-3.1-Ubuntu-16.04-Cuda-8.md
Last active December 12, 2019 21:36
Installing OpenCV 3.1 on Ubuntu 16.04 with Cuda 8 support

This is a guide for installing OpenCV 3.1 on Ubuntu 16.04 with Cuda 8 support. This has been tested using a system with a GeForce GTX 1060 and on one with a GeForce GTX 1080.

Nvidia Drivers with Compiz

Install Nvidia drivers

# Start clean
sudo apt purge nvidia-*
# Add the PPA
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
@tokestermw
tokestermw / rnn_viz_keras.py
Last active April 6, 2019 18:40
Recurrent Neural Network (RNN) visualizations using Keras.
from __future__ import print_function
from keras import backend as K
from keras.engine import Input, Model, InputSpec
from keras.layers import Dense, Activation, Dropout, Lambda
from keras.layers import Embedding, LSTM
from keras.optimizers import Adam
from keras.preprocessing import sequence
from keras.utils.data_utils import get_file
from keras.datasets import imdb
@mbollmann
mbollmann / attention_lstm.py
Last active June 26, 2023 10:08
My attempt at creating an LSTM with attention in Keras
class AttentionLSTM(LSTM):
"""LSTM with attention mechanism
This is an LSTM incorporating an attention mechanism into its hidden states.
Currently, the context vector calculated from the attended vector is fed
into the model's internal states, closely following the model by Xu et al.
(2016, Sec. 3.1.2), using a soft attention model following
Bahdanau et al. (2014).
The layer expects two inputs instead of the usual one:
@mir4ef
mir4ef / git-remove
Created June 30, 2016 17:59
Remove a file/folder from git repo, but keep local
git rm --cached file-name.txt
git rm -r --cached folder-name
git commit -m "removed file-name and/or folder-name"
git push origin master or branch-name
# This is inspired by the fantastic guide https://github.com/saiprashanths/dl-setup
# I have just updated the python-related commands so that everything works in Python 3.
# Tested on Xubuntu 16.04.
# First of all let's update the repos:
sudo apt-get update
# Only if you have a CUDA-compatible Nvidia card, install CUDA.
# Check on the Nvidia website what is the latest driver version which supports your card.
# At the time of this writing it was 367.
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active April 23, 2024 02:03
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@rtfpessoa
rtfpessoa / handle-ctrl-c.py
Created March 19, 2016 11:28
Handle CTRL+C in Python
#!/usr/bin/env python
import signal
import sys
def signal_handler(signal, frame):
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
@artieziff
artieziff / mongodb.md
Created October 29, 2013 23:46
MongoDb & Python Essentials

##MONGODB & PYTHON

###Ubuntu Install

sudo apt-get install mongodb
pip install pymongo

Table - Collection
Column - Property
Row - Document

@audreyfeldroy
audreyfeldroy / pypi-release-checklist.md
Last active February 23, 2023 15:03
My PyPI Release Checklist
  • Update HISTORY.md
  • Commit the changes:
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
@glamp
glamp / svmflag.py
Last active March 5, 2021 06:59
Plotting SVM predictions using matplotlib and sklearn
import numpy as np
import pylab as pl
import pandas as pd
from sklearn import svm
from sklearn import linear_model
from sklearn import tree
from sklearn.metrics import confusion_matrix