Skip to content

Instantly share code, notes, and snippets.

View martisak's full-sized avatar

Martin Isaksson martisak

View GitHub Profile
@elgehelge
elgehelge / mnist_estimator.py
Last active May 22, 2022 21:43 — forked from peterroelants/mnist_estimator.py
Example using TensorFlow Estimator, Experiment & Dataset on MNIST data.
"""Script to illustrate usage of tf.estimator.Estimator in TF v1.5"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
from tensorflow.contrib import slim
# Show debugging output
tf.logging.set_verbosity(tf.logging.DEBUG)
# Set default flags for the output directories
@alsrgv
alsrgv / horovod_model_parallelism.py
Created January 27, 2018 06:20
Model parallelism in Horovod
# Copyright 2018 Uber Technologies, Inc. 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,
@alistaire47
alistaire47 / markdown.R
Last active October 18, 2018 19:41
read markdown table into R data frame
# base R version
read.markdown <- function(file, stringsAsFactors = FALSE, strip.white = TRUE, ...){
if (length(file) > 1) {
lines <- file
} else if (grepl('\n', file)) {
con <- textConnection(file)
lines <- readLines(con)
close(con)
} else {
lines <- readLines(file)
@alsrgv
alsrgv / tensorflow_mnist_estimator.py
Last active February 8, 2023 10:05
Horovod with Estimator API
# Copyright 2017 Uber Technologies, Inc. All Rights Reserved.
# Copyright 2016 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
@gyglim
gyglim / tensorboard_logging.py
Last active August 23, 2023 21:29
Logging to tensorboard without tensorflow operations. Uses manually generated summaries instead of summary ops
"""Simple example on how to log scalars and images to tensorboard without tensor ops.
License: BSD License 2.0
"""
__author__ = "Michael Gygli"
import tensorflow as tf
from StringIO import StringIO
import matplotlib.pyplot as plt
import numpy as np
@RodrigoPrior
RodrigoPrior / subfig.tex
Last active December 15, 2022 16:44
subfig latex example
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}[!ht]
\centering
\caption{Caption superior.}
@cmarinbe
cmarinbe / logging_color.py
Created March 16, 2016 15:55
Configuring python logging with colorlog
#!/usr/bin/env python
# =============================================================================
# @file logging_color.py
# @author C. Marin Benito (carla.marin.benito@cern.ch)
# @date 16.03.2016
# =============================================================================
"""
This functions configures a logger using logging and colorlog
and returns the logger for further usage
By default, time, name of the logger and message with the default
@jnothman
jnothman / forkme.svg
Last active November 17, 2021 05:08
"Fork me on GitHub" ribbon in LaTeX/TikZ vector graphic
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrmoran
jrmoran / app.js
Created October 23, 2012 12:50
AngularJS - basic async request
var App = angular.module('App', []);
App.controller('TodoCtrl', function($scope, $http) {
$http.get('todos.json')
.then(function(res){
$scope.todos = res.data;
});
});
@mkaz
mkaz / web_timing.py
Created July 4, 2012 14:55
Use Selenium to Measure Web Timing
#!/usr/bin/env python
"""
Use Selenium to Measure Web Timing
Performance Timing Events flow
navigationStart -> redirectStart -> redirectEnd -> fetchStart -> domainLookupStart -> domainLookupEnd
-> connectStart -> connectEnd -> requestStart -> responseStart -> responseEnd
-> domLoading -> domInteractive -> domContentLoaded -> domComplete -> loadEventStart -> loadEventEnd