Skip to content

Instantly share code, notes, and snippets.

@rchgit
rchgit / install_packages.sh
Created October 31, 2017 02:28 — forked from luiscape/install_packages.sh
Install Python dependency packages from requirements.txt using conda.
#
# Original solution via StackOverflow:
# http://stackoverflow.com/questions/35802939/install-only-available-packages-using-conda-install-yes-file-requirements-t
#
#
# Install via `conda` directly.
# This will fail to install all
# dependencies. If one fails,
# all dependencies will fail to install.
@rchgit
rchgit / ffmpeg-nonfree-build-centos-7.sh
Last active October 26, 2017 17:56 — forked from silverkorn/ffmpeg-nonfree-build-centos-7.sh
An automated script to build FFmpeg non-free on RHEL/CentOS with as much features as possible. (Including mediainfo for debugging)
# TODO: Verify to link statically some dependencies usually not available in a default instllation of RHEL/CentOS (ex.: libxcb)
###################
## Configuration ##
###################
export FFMPEG_CPU_COUNT=$(nproc)
export FFMPEG_ENABLE="--enable-gpl --enable-version3 --enable-nonfree --enable-runtime-cpudetect --enable-gray --enable-openssl --enable-libfreetype"
export FFMPEG_HOME=/usr/local/src/ffmpeg
1324/1324 [==============================] - 1s - loss: 0.0045 - acc: 1.0000 - categorical_accuracy: 1.0000 - top_k_cate
gorical_accuracy: 1.0000 - mean_absolute_error: 9.8899e-04 - mean_squared_error: 1.9106e-05 - val_loss: 0.0102 - val_acc
: 1.0000 - val_categorical_accuracy: 1.0000 - val_top_k_categorical_accuracy: 1.0000 - val_mean_absolute_error: 0.0020 -
val_mean_squared_error: 3.0197e-04
Epoch 20/50
128/1324 [=>............................] - ETA: 0s - loss: 0.0035 - acc: 1.0000 - categorical_accuracy: 1.0000 - top_k
384/1324 [=======>......................] - ETA: 0s - loss: 0.0037 - acc: 1.0000 - categorical_accuracy: 1.0000 - top_k
640/1324 [=============>................] - ETA: 0s - loss: 0.0042 - acc: 1.0000 - categorical_accuracy: 1.0000 - top_k
896/1324 [===================>..........] - ETA: 0s - loss: 0.0041 - acc: 1.0000 - categorical_accuracy: 1.0000 - top_k
1152/1324 [=========================>....] - ETA: 0s - loss: 0.0040 - acc: 1.0000 - categorical_accuracy: 1.0000 - top_k
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rchgit
rchgit / Contract Killer 3.md
Created April 26, 2017 03:35
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

import tensorflow as tf
import tflearn
import os
import numpy as np
import time
from collections import deque
from sklearn.model_selection import train_test_split
from tflearn.data_utils import to_categorical
import imageio
import os
import numpy as np
import tensorflow as tf
import tflearn
import pickle
from collections import deque
from sklearn.model_selection import train_test_split
from tflearn.data_utils import to_categorical
@rchgit
rchgit / gitlab-ipython-notebook.md
Created December 21, 2016 12:44 — forked from martijnvermaat/gitlab-ipython-notebook.md
View IPython notebooks in GitLab

Viewing IPython notebooks in GitLab

GitLab is open source software to collaborate on code (a GitHub clone to run on your own server). Clicking a blob (a file in a repository) in GitLab shows a nice rendering if GitLab supports the file type (e.g., images, Markdown documents), or its content as plain text otherwise. The patch described here adds support to GitLab for rendering IPython notebooks (.ipynb files).

import csv
import glob
file_list = glob.glob("*/*.csv")
print(file_list)
for file_name in file_list:
with open(file_name, "r") as source:
rdr = csv.reader(source)
with open(file_name+"-lstm", "w") as result:
def load_data(data_dir, labels):
X_signals_train = np.zeros((1,9))
X_signals_test = np.zeros((1,9))
y_train = np.zeros([1,1])
y_test = np.zeros([1,1])
for label in labels:
for root, dirs, files in os.walk(data_dir + "/" + label):
for filename in files:
signal = genfromtxt(data_dir + "/" + label + "/" + filename, delimiter=',')
#print (signal)