Skip to content

Instantly share code, notes, and snippets.

View vfdev-5's full-sized avatar
:octocat:
.\ |

vfdev vfdev-5

:octocat:
.\ |
View GitHub Profile
@kolergy
kolergy / StupidLife_V0.5.4.py
Last active January 23, 2017 20:57
Stupid Life: it's stupid but it moves, NN & GA
#!/usr/freeware/bin/python
## #!/home/QtPalmtop/bin/python
#-------------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------------
# Ustructured NN
# Kolergy
# Written in Python. See http://www.python.org/
#-------------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------------
@hagerty
hagerty / CosmiQNet.Alternative.py
Last active February 27, 2017 14:12
Alternative architecture for CosmiQNet
with tf.device(gpu):
# Generator
x8 = tf.placeholder(tf.float32, shape=[None, FLAGS.ws, FLAGS.ws, 8])
x3 = tf.placeholder(tf.float32, shape=[None, scale * FLAGS.ws, scale * FLAGS.ws, 3])
label_distance = tf.placeholder(tf.float32, shape=[None, FLAGS.ws, FLAGS.ws, 1])
for i in range(layers):
alpha[i] = tf.Variable(0.9, name='alpha_' + str(i))
beta[i] = tf.maximum( 0.0 , tf.minimum ( 1.0 , alpha[i] ), name='beta_'+str(i))
bi[i] = tf.Variable(tf.constant(0.0,shape=[FLAGS.filters]), name='bi_'+str(i))
bo[i] = tf.Variable(tf.constant(0.0,shape=[FLAGS.filters]), name='bo_'+str(i))
@ndronen
ndronen / model.py
Last active April 28, 2018 19:50
Semantic segmentation with ENet in PyTorch
#!/usr/bin/env python
"""
A quick, partial implementation of ENet (https://arxiv.org/abs/1606.02147) using PyTorch.
The original Torch ENet implementation can process a 480x360 image in ~12 ms (on a P2 AWS
instance). TensorFlow takes ~35 ms. The PyTorch implementation takes ~25 ms, an improvement
over TensorFlow, but worse than the original Torch.
"""
from __future__ import absolute_import
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@peterbell10
peterbell10 / build.sh
Last active August 18, 2020 13:21
Building pytorch using conda
#!/bin/bash
# Activate the build environment
eval "$(conda shell.bash hook)"
conda activate pytorch-dev
cd ~/git/pytorch
# Enable ccache
export CCACHE_COMPRESS=true
@n2cholas
n2cholas / benchmark.py
Created September 6, 2020 19:15
Benchmarking ignite master branch vs metrics_impl on metrics.
'''
To run the CPU benchmark: `CUDA_VISIBLE_DEVICES="" python benchmark.py --name cpu`
To run the GPU benchmark: `CUDA_VISIBLE_DEVICES=0 python benchmark.py --name cuda`
To run the distributed benchmark: `python -u -m torch.distributed.launch --nproc_per_node=2 --use_env benchmark.py --name dist`
'''
import argparse
import time
import math
@lirnli
lirnli / Pytorch RNN.ipynb
Last active October 17, 2020 07:19
Pytorch RNN examples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@schwehr
schwehr / gdal_geotiff_metadata.ipynb
Created February 22, 2013 19:57
Using gdal to read/write the metadata fields for a geotiff and for specific bands within the geotiff.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andrewjjenkins
andrewjjenkins / Dockerfile.minikube
Created January 23, 2018 21:28
Istio-Minikube and Jenkins
# Portions Copyright 2016 The Kubernetes Authors All rights reserved.
# Portions Copyright 2018 AspenMesh
#
# 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
@ericspod
ericspod / baseengine.py
Last active April 11, 2021 23:29
Base Engine, Trainer, and Evaluator
import torch
import warnings
import threading
import numpy as np
from ignite.engine.engine import Engine, Events
def ensure_tuple(vals):
"""
Returns a tuple containing just `vals` if it is not a list or tuple, or `vals` converted to a tuple otherwise.