This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Nov 24 12:57:55 2020 | |
@author: tlinden | |
elastic net penalized cox regression | |
with (dummy coding) and standardization | |
stacked in a sklearn pipeline | |
tuned with bayesian hyperparamter optimization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in order to load the .bashrc by default, it must be in the `.bash_profile` | |
# https://askubuntu.com/questions/161249/bashrc-not-executed-when-opening-new-terminal | |
# include .bashrc if it exists | |
if [ -f "$HOME/.bashrc" ]; then | |
. "$HOME/.bashrc" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
see https://www.meistertask.com/app/task/29UR1Jpo/shap-keras-tf-test-package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gpu_assignment(gpus, allow_growth = True, per_process_gpu_memory_fraction = 0.95): | |
# GPU assignment | |
###################################################### | |
# !! run this BEFORE importing TF or keras !! | |
# run code only on a single, particular GPU | |
# from http://kawahara.ca/select-single-gpu-keras/ | |
###################################################### | |
import os | |
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
echo " date time $(free -m | grep total | sed -E 's/^ (.*)/\1/g')" | |
while true; do | |
echo "$(date '+%Y-%m-%d %H:%M:%S') $(free -m | grep Mem: | sed 's/Mem://g')" | |
sleep 1 | |
done |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NVIDIA_DRIVER_VERSION=352.63 | |
NVIDIA_CUDA_VERSION=7.5 | |
NVIDIA_CUDA_FULL_VERSION=7.5.18 | |
sudo yum update -y | |
sudo yum groupinstall -y "Development tools" | |
sudo yum install kernel-devel-`uname -r` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
class Timer(object): | |
"""A simple timer class""" | |
def __init__(self): | |
pass | |
def start(self): | |
"""Starts the timer""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.models import Sequential | |
from keras.layers import Dense | |
from keras.utils.io_utils import HDF5Matrix | |
import numpy as np | |
def create_dataset(): | |
import h5py | |
X = np.random.randn(200,10).astype('float32') | |
y = np.random.randint(0, 2, size=(200,1)) | |
f = h5py.File('test.h5', 'w') |
NewerOlder