Skip to content

Instantly share code, notes, and snippets.

@DavidWiesner
DavidWiesner / flowers-nasnet.sh
Last active November 19, 2018 09:41
Performance decrease in TensorFlow 1.9 for large graphs #23847
#!/usr/bin/env bash
[ ! -d "models" ] && git clone https://github.com/tensorflow/models.git
cd models/research/slim/
MODEL_NAME="nasnet_large"
TRAIN_DIR=/tmp/flowers-models/${MODEL_NAME}
DATASET_DIR=/tmp/flowers
export TF_CUDNN_WORKSPACE_LIMIT_IN_MB=500
export CUDA_DEVICE_ORDER="PCI_BUS_ID"
export CUDA_VISIBLE_DEVICES="0,1"
@DavidWiesner
DavidWiesner / train_val.prototxt
Last active October 19, 2017 08:23
CUB_googLeNet_ST
name: "CUB_GoogleNet_ST"
layer {
name: "data"
type: "ImageData"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
@DavidWiesner
DavidWiesner / SVLibSVM.java
Created November 16, 2015 19:24
Access support vector in LibSVM and Weka
public class SVLibSVM {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new FileReader("data/diabetes.arff"));
Instances data = new Instances(reader);
reader.close();
data.setClassIndex(data.numAttributes() - 1);
// create Model
LibSVM libsvmModel = new LibSVM();
@DavidWiesner
DavidWiesner / helper.php
Created March 18, 2015 16:05
Owncloud Upload Max. 0 B
<?php
public static function maxUploadFilesize($dir, $freeSpace = null) {
if (is_null($freeSpace) || $freeSpace < 0){
$freeSpace = self::freeSpace($dir);
}
return $freeSpace === INF ? self::uploadLimit() : min($freeSpace, self::uploadLimit());
}
@DavidWiesner
DavidWiesner / Metabox-Builder.php
Last active August 29, 2015 14:13
Builder Pattern for Wordpress MetaBox plugin see cpt-persons.php and page-person.php for usage
<?php
/*
* Copyright (C) 2015 David Wiesner
*
* 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
*
@DavidWiesner
DavidWiesner / duckduckgo.user.js
Created May 22, 2014 09:57
UserScript for opera duckduckgo fix onkeypress not detected
// ==UserScript==
// @name
// @namespace events.script
// @include http://duckduckgo.com/*
// @include https://duckduckgo.com/*
// @match http://duckduckgo.com/*
// @match https://duckduckgo.com/*
// @run-at document-end
// ==/UserScript==
(function () {
#!/bin/bash
function echoError(){
red='\e[0;31m'; NC='\e[0m' # No Color
[ $# -gt 0 ] && echo -e "${red}$1${NC}" >&2
}
function echoInfo(){
COLOR='\e[0;32m'; NC='\e[0m' # No Color
[ $# -gt 0 ] && echo -e "${COLOR}$1${NC}" >&2