Skip to content

Instantly share code, notes, and snippets.

View alexshires's full-sized avatar

Alex Shires alexshires

View GitHub Profile
@alexshires
alexshires / copy_file.py
Last active June 11, 2020 09:54
copy files using python
#! /usr/bin/env python3
"""
utilty to reliably SCP using Python
"""
import os
import subprocess
import argparse
import glob
import logging
#! /usr/bin/env python3
"""
Script to compare outputs of find-cpu-hogs.sh
Alex Shires
14-05-2020
"""
import logging
import os
import sys
@alexshires
alexshires / cpu_analysis
Last active May 14, 2020 21:09
CPU analysis script
#! /usr/bin/env python3
"""
Script to parse the CPU hog
* Alex Shires - 28-4-2020
"""
import logging
import os
import sys
import pandas as pd
@alexshires
alexshires / .tmux.conf
Created August 24, 2018 12:26
configfiles
# ---------------------
# Configuration
# ---------------------
# use UTF8 unicode
set -g utf8
set-window-option -g utf8 on
set -g status-utf8 on
@alexshires
alexshires / multi-ts-lstm.py
Created January 25, 2017 14:19 — forked from lukovkin/multi-ts-lstm.py
Time series prediction with multiple sequences input - LSTM - 1
# Time Series Testing
import keras.callbacks
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Dense, Dropout
from keras.layers.recurrent import LSTM
# Call back to capture losses
class LossHistory(keras.callbacks.Callback):
def on_train_begin(self, logs={}):
self.losses = []
python Downloads/tensorflow_error_tutorial.py
WARNING:tensorflow:Change warning: default value of `enable_centered_bias` will change after 2016-10-09. It will be disabled by default.Instructions for keeping existing behaviour:
Explicitly set `enable_centered_bias` to 'True' if you want to keep existing behaviour.
INFO:tensorflow:Using config: {'task': 0, 'save_summary_steps': 100, 'keep_checkpoint_max': 5, '_is_chief': True, 'save_checkpoints_secs': 1, 'evaluation_master': '', 'tf_config': gpu_options {
per_process_gpu_memory_fraction: 1
}
, 'master': '', 'keep_checkpoint_every_n_hours': 10000, '_job_name': None, 'cluster_spec': None, 'tf_random_seed': None, 'num_ps_replicas': 0}
INFO:tensorflow:Setting feature info to TensorSignature(dtype=tf.float32, shape=TensorShape([Dimension(None), Dimension(4)]), is_sparse=False)
INFO:tensorflow:Setting targets info to TensorSignature(dtype=tf.int64, shape=TensorShape([Dimension(None)]), is_sparse=False)
INFO:tensorflow:Transforming feature_column _RealValuedColumn(c
# coding: utf-8
# In[7]:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
@alexshires
alexshires / test_luigi2.py
Created October 29, 2015 11:46
luigi doesn't check for local file output
import os
import luigi
class FileExists(luigi.ExternalTask):
filename = luigi.Parameter(default=None)
def output(self):
print "FE: output", self.filename
return luigi.LocalTarget(self.filename)
def create_new_filename(filename, ext):
""" TEST Luigi processes """
import os
def python_function(filename1):
# from filename1 create filename2
if "." not in filename1:
print "can't split"
return None
class testClass:
def foo(self, x):
print "foo", x
def bar(self, y):
print "bar", y