Skip to content

Instantly share code, notes, and snippets.

/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java -Xmx10g -Didea.launcher.port=7532 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 14 CE.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre/lib/h
elastix is started at Fri Mar 25 16:08:57 2016.
-------------------------------------------------------------------------
Running elastix with parameter map 0
Current time: Fri Mar 25 16:08:57 2016.
Installing all components.
InstallingComponents was successful.
{
"cells": [
{
"cell_type": "code",
"execution_count": 44,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
@mongoose54
mongoose54 / gist:71e174587fbec8c2fe970e8a1c14eff4
Created February 21, 2017 03:23
Calculate dice score for arbitrary number of classes (beyond 2)
#to_categorical() acquired from Keras implementation
#dice_coef() inspired by Marco Jocic's implementation: https://github.com/jocicmarko/ultrasound-nerve-segmentation/blob/master/train.py
def to_categorical(y, nb_classes=None):
"""Converts a class vector (integers) to binary class matrix.
E.g. for use with categorical_crossentropy.
# Arguments
y: class vector to be converted into a matrix
(integers from 0 to nb_classes).
_author__ = 'Fabian Isensee'
from collections import OrderedDict
from lasagne.layers import InputLayer, ConcatLayer, Pool2DLayer, ReshapeLayer, DimshuffleLayer, NonlinearityLayer, DropoutLayer, Upscale2DLayer, Upscale3DLayer, BatchNormLayer, batch_norm
from lasagne.layers.dnn import Conv3DDNNLayer as ConvLayer, Pool3DDNNLayer as PoolLayer
import lasagne
from lasagne.init import HeNormal
def build_UNet(n_input_channels=1, BATCH_SIZE=None, num_output_classes=2, pad='same', nonlinearity=lasagne.nonlinearities.elu, input_dim=(128, 128), depth=32, base_n_filters=32, kernel_size=3, do_dropout=False):
net = OrderedDict()
____________________________________________________________________________________________________
convolution2d_134 (Convolution2D (None, 2, 64, 80) 66 convolution2d_133[0][0]
____________________________________________________________________________________________________
permute_5 (Permute) (None, 64, 80, 2) 0 convolution2d_134[0][0]
____________________________________________________________________________________________________
reshape_7 (Reshape) (None, 5120, 2) 0 permute_5[0][0]
____________________________________________________________________________________________________
activation_6 (Activation) (None, 5120, 2) 0 reshape_7[0][0]
@mongoose54
mongoose54 / gist:2420a55ef51a8561eb6a3a2930ca4520
Created February 22, 2017 21:33
UNet with cross-entropy
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.