CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Do fully convolutional networks actually work?

Open pauldragan opened this issue 10 years ago • 10 comments

Hello,

I am trying to train a fully convolutional network for a segmentation problem I am working on.

I spent a couple of days tweaking my configuration and trying different methods, but still the output of the network will always tend to zero and the MSE will reach (and stay around) some high value.

I also tried the 04_Deconv example from the Examples/Image/MNIST folder which uses a fully convolutional architecture and it yields the same results, indicating that the training is not done properly.

Am I experiencing some weird behavior of the toolkit on my configuration or just some known bugs?

Hardware/Software config: CTNK 1.6 (from binaries), video card with CUDA compute capability >= 3.0, Windows 7.

pauldragan avatar Aug 23 '16 13:08 pauldragan

CUDA 8?

ValleZ avatar Aug 24 '16 00:08 ValleZ

No, I am using version 7.5, as recommended.

pauldragan avatar Aug 24 '16 05:08 pauldragan

Hi Paul, Can you share your configuration please ? :)

mfuntowicz avatar Aug 25 '16 10:08 mfuntowicz

Hi Morgan,

Sure. My NDL configuration file:

# macros to include
load = ndlMnistMacros

# the actual NDL that defines the network
run = DNN

ndlMnistMacros = [
    imageW = 60
    imageH = 60
    imageC = 3

    truthW = 60
    truthH = 60
    truthC = 1

    features = ImageInput(imageW, imageH, imageC,tag = feature, imageLayout=$imageLayout$)
    featScale = Constant(0.00390625)
    featScaled = Scale(featScale, features)

    truth = ImageInput(truthW, truthH, truthC, tag = feature,imageLayout=$imageLayout$)
    truthScale = Constant(0.00390625)
    truthScaled = Scale(truthScale, truth)
]

DNN=[
    # conv1
    kW1 = 3
    kH1 = 3
    cMap1 = 32
    hStride1 = 1
    vStride1 = 1
    wScale1 = 1
    bValue1 = 0
    conv1 = Conv2DReLULayer(featScaled, cMap1, 27, kW1, kH1, hStride1, vStride1, wScale1, bValue1)

    # conv2
    kW2 = 1
    kH2 = 1
    cMap2 = 128
    hStride2 = 1
    vStride2 = 1
    wScale2 = 1
    bValue2 = 0
    conv2 = Conv2DReLULayer(conv1, cMap2, 32, kW2, kH2, hStride2, vStride2, wScale2, bValue2)   

    # conv3
    kW3 = 1
    kH3 = 1
    cMap3 = 1
    hStride3 = 1
    vStride3 = 1
    wScale3 = 1
    bValue3 = 0

    conv3 = Conv2DReLULayer(conv2, cMap3, 128, kW3, kH3, hStride3, vStride3, wScale3, bValue3)  

    #mse = SquareError(truthScaled, deconv1)
    mse = SquareError(truthScaled, conv3)
    #mse = ElementTimes(Minus(truthScaled, conv3),Minus(truthScaled, conv3))
    #err = ErrorPrediction(labels, ol)

    # Special Nodes
    FeatureNodes = (features)
    CriterionNodes = (mse)
    OutputNodes = (featScaled, truthScaled, conv1.out, conv2.out, conv3.out, mse)
]

And my .cntk file:


RootDir = ".."

ConfigDir = "$RootDir$/Config"
DataDir   = "$RootDir$/Data"
OutputDir = "$RootDir$/Output"
ModelDir  = "$OutputDir$/Models"
ResultsDir= "$OutputDir$/Results"

deviceId = 0
imageLayout = "cudnn"

command = train:output

precision = "float"
modelPath = "$ModelDir$/03_Segmentation"
ndlMacros = "$ConfigDir$/Macros.ndl"

# uncomment the following line to write logs to a file 
 stderr = "$OutputDir$/03_Segmentation_out"
traceLevel=1
numMBsToShowResult=500

prefetch=true

initOnCPUOnly=true

#######################################
#  TRAINING CONFIG                    #
#######################################

train = [
    action = "train"

    NDLNetworkBuilder = [
        networkDescription = "$ConfigDir$/03_Segmentation.ndl"
    ]

    SGD = [
        epochSize = 6000
        minibatchSize = 40
        learningRatesPerMB = 3.2
        momentumPerMB = 0.9
        maxEpochs = 15
    ]

    reader = [
        readerType = "CNTKTextFormatReader"

        file = "$DataDir$/input_6000_60x60_inv_train.txt"
        input = [
            features = [
                alias = feature
                dim = 10800
                format = "dense"
            ]
            truth = [
                alias = truth
                dim = 3600
                format = "dense"
            ]
        ]
    ]   
]

#######################################
#  TEST CONFIG                        #
#######################################

test = [
    action = "test"

    NDLNetworkBuilder = [
        networkDescription = "$ConfigDir$/03_Segmentation.ndl"
    ]

    minibatchSize = 32

    reader = [
        readerType = "CNTKTextFormatReader"

        file = "$DataDir$/input_6000_60x60_test.txt"
        input = [
            features = [
                alias = feature
                dim = 10800
                format = "dense"
            ]
            truth = [
                alias = truth
                dim = 3600
                format = "dense"
            ]
        ]
    ]   
]

#######################################
#  WRITE CONFIG                       #
#######################################

output = [
    action = "write"

    NDLNetworkBuilder = [
        networkDescription = "$ConfigDir$/03_Segmentation.ndl"
    ]

    minibatchSize = 1
    outputPath = "$OutputDir$/Results/03_Segmentation_output"

    reader = [
        readerType = "CNTKTextFormatReader"

        file = "$DataDir$/input_6000_60x60_inv_train.txt"
        input = [
            features = [
                alias = feature
                dim = 10800
                format = "dense"
            ]
            truth = [
                alias = truth
                dim = 3600
                format = "dense"
            ]
        ]
    ]   
]

#######################################
#  PLOT  CONFIG                       #
#######################################

topoplot = [
    action = "plot"
    modelPath = "$ModelDir$/03_Segmentation.0"

    # outputdotFile specifies the dot file to output
    # if the user does not specify this, it will be ${modelPath}.dot
    outputdotFile = "03_Segmentation.dot" 

    # outputFile specifies the rendered image
    outputFile="03_Segmentation.jpg" 

    # if RenderCmd is specified, CNTK will call the plot command after replacing
    # <IN> with ${outputdotFile} and <OUT> with ${outputfile}
    renderCmd="dot -Tjpg <IN> -o<OUT>"
]


pauldragan avatar Aug 25 '16 12:08 pauldragan

I don't see a fundamental problem. I suspect either an incorrectly configured Convolution (there are some pitfalls, will look more closely later), or simply some problem with the hyperparameters. E.g. your learning rate seems quite high.

conv3 = Conv2DReLULayer(conv2, cMap3, 128, kW3, kH3, hStride3, vStride3, wScale3, bValue3)

I don't have Conv2DReLULayer() in front of me--the 128 is the number of output channels, right? What does that mean in the context of your criterion? I presume your image has 3 channels, not 128. But then why would the criterion even pass, if the dimensions are mismatching?

Would you mind posting:

  • the last 20 lines of the Validation section of the log
  • the log section that shows the progression of training objective values? (Finished...ce=...)

frankseide avatar Aug 25 '16 15:08 frankseide

or simply some problem with the hyperparameters. E.g. your learning rate seems quite high.

The problem persists even for low learning rates. I actually started from a lower one and kept on increasing it hoping that I would obtain better results.

I don't have Conv2DReLULayer() in front of me--the 128 is the number of output channels, right? What does that mean in the context of your criterion? I presume your image has 3 channels, not 128. But then why would the criterion even pass, if the dimensions are mismatching?

128 is the number of input weights for each filter/channel and it is given by kernel_width x kernel_height x number_of_input channels. The number of filters/channels for that layer is stored in cMap3 and it is equal with 1.

the last 20 lines of the Validation section of the log

I don't really know where the validation section ends, so I'll post everything before the actual training begins.

Validating network. 22 nodes to process in pass 1.

Validating --> conv1.w.W = LearnableParameter() :  -> [32 x 27]
Validating --> featScale = LearnableParameter() :  -> [1 x 1]
Validating --> features = InputValue() :  -> [60 x 60 x 3 x *]
Validating --> featScaled = ElementTimes (featScale, features) : [1 x 1], [60 x 60 x 3 x *] -> [60 x 60 x 3 x *]
Validating --> conv1.c.c = Convolution (conv1.w.W, featScaled) : [32 x 27], [60 x 60 x 3 x *] -> [60 x 60 x 32 x *]
Validating --> conv1.b.b = LearnableParameter() :  -> [1 x 1 x 32]
Validating --> conv1.cpb = Plus (conv1.c.c, conv1.b.b) : [60 x 60 x 32 x *], [1 x 1 x 32] -> [60 x 60 x 32 x *]
Validating --> conv1.out = RectifiedLinear (conv1.cpb) : [60 x 60 x 32 x *] -> [60 x 60 x 32 x *]
Validating --> conv2.w.W = LearnableParameter() :  -> [128 x 32]
Validating --> conv2.c.c = Convolution (conv2.w.W, conv1.out) : [128 x 32], [60 x 60 x 32 x *] -> [60 x 60 x 128 x *]
Validating --> conv2.b.b = LearnableParameter() :  -> [1 x 1 x 128]
Validating --> conv2.cpb = Plus (conv2.c.c, conv2.b.b) : [60 x 60 x 128 x *], [1 x 1 x 128] -> [60 x 60 x 128 x *]
Validating --> conv2.out = RectifiedLinear (conv2.cpb) : [60 x 60 x 128 x *] -> [60 x 60 x 128 x *]
Validating --> conv3.w.W = LearnableParameter() :  -> [1 x 128]
Validating --> conv3.c.c = Convolution (conv3.w.W, conv2.out) : [1 x 128], [60 x 60 x 128 x *] -> [60 x 60 x 1 x *]
Validating --> conv3.b.b = LearnableParameter() :  -> [1 x 1 x 1]
Validating --> conv3.cpb = Plus (conv3.c.c, conv3.b.b) : [60 x 60 x 1 x *], [1 x 1 x 1] -> [60 x 60 x 1 x *]
Validating --> conv3.out = RectifiedLinear (conv3.cpb) : [60 x 60 x 1 x *] -> [60 x 60 x 1 x *]
Validating --> truthScale = LearnableParameter() :  -> [1 x 1]
Validating --> truth = InputValue() :  -> [60 x 60 x 1 x *]
Validating --> truthScaled = ElementTimes (truthScale, truth) : [1 x 1], [60 x 60 x 1 x *] -> [60 x 60 x 1 x *]
Validating --> mse = SquareError (truthScaled, conv3.out) : [60 x 60 x 1 x *], [60 x 60 x 1 x *] -> [1]

Validating network. 12 nodes to process in pass 2.


Validating network, final pass.


conv1.c.c: using cuDNN convolution engine for geometry: Input: 60 x 60 x 3, Output: 60 x 60 x 32, Kernel: 3 x 3 x 3, Map: 1 x 1 x 32, Stride: 1 x 1 x 3, Sharing: (1), AutoPad: (1), LowerPad: 0, UpperPad: 0.

conv2.c.c: using cuDNN convolution engine for geometry: Input: 60 x 60 x 32, Output: 60 x 60 x 128, Kernel: 1 x 1 x 32, Map: 1 x 1 x 128, Stride: 1 x 1 x 32, Sharing: (1), AutoPad: (1), LowerPad: 0, UpperPad: 0.

conv3.c.c: using cuDNN convolution engine for geometry: Input: 60 x 60 x 128, Output: 60 x 60 x 1, Kernel: 1 x 1 x 128, Map: 1 x 1 x 1, Stride: 1 x 1 x 128, Sharing: (1), AutoPad: (1), LowerPad: 0, UpperPad: 0.


9 out of 22 nodes do not share the minibatch layout with the input data.

Post-processing network complete.

Created model with 22 nodes on GPU 0.

Training criterion node(s):
    mse = SquareError


Allocating matrices for forward and/or backward propagation.

Memory Sharing Structure:

0000000000000000: {[featScale Gradient[1 x 1]] [featScaled Gradient[60 x 60 x 3 x *]] [features Gradient[60 x 60 x 3 x *]] [truth Gradient[60 x 60 x 1 x *]] [truthScale Gradient[1 x 1]] [truthScaled Gradient[60 x 60 x 1 x *]] }
0000000008414F30: {[features Value[60 x 60 x 3 x *]] }
000000000BDF7C80: {[featScale Value[1 x 1]] }
000000000BDF7E60: {[truth Value[60 x 60 x 1 x *]] }
000000000BDF7FA0: {[truthScale Value[1 x 1]] }
000000000BDF8180: {[conv1.w.W Value[32 x 27]] }
000000000BDF82C0: {[conv1.b.b Value[1 x 1 x 32]] }
000000000BDF85E0: {[conv2.w.W Value[128 x 32]] }
000000000BDF8720: {[conv2.b.b Value[1 x 1 x 128]] }
000000000BDF8A40: {[conv3.w.W Value[1 x 128]] }
000000000BDF8B80: {[conv3.b.b Value[1 x 1 x 1]] }
000000002CC34830: {[featScaled Value[60 x 60 x 3 x *]] }
000000002D2368A0: {[truthScaled Value[60 x 60 x 1 x *]] }
000000002D236940: {[conv1.out Value[60 x 60 x 32 x *]] }
000000002D2369E0: {[conv2.out Value[60 x 60 x 128 x *]] }
000000002D236A80: {[conv3.out Value[60 x 60 x 1 x *]] }
000000002D236B20: {[mse Value[1]] }
000000002D236BC0: {[conv1.c.c Value[60 x 60 x 32 x *]] }
000000002D236D00: {[conv1.cpb Value[60 x 60 x 32 x *]] [conv1.w.W Gradient[32 x 27]] }
000000002D236DA0: {[conv1.b.b Gradient[1 x 1 x 32]] [conv2.c.c Value[60 x 60 x 128 x *]] }
000000002D236E40: {[conv1.cpb Gradient[60 x 60 x 32 x *]] }
000000002D236EE0: {[conv2.cpb Value[60 x 60 x 128 x *]] [conv2.w.W Gradient[128 x 32]] }
000000002D236F80: {[conv2.b.b Gradient[1 x 1 x 128]] [conv3.c.c Value[60 x 60 x 1 x *]] }
000000002D237020: {[conv1.c.c Gradient[60 x 60 x 32 x *]] [conv1.out Gradient[60 x 60 x 32 x *]] [conv2.cpb Gradient[60 x 60 x 128 x *]] }
000000002D2370C0: {[conv3.cpb Value[60 x 60 x 1 x *]] [conv3.w.W Gradient[1 x 128]] }
000000002D237200: {[mse Gradient[1]] }
000000002D2372A0: {[conv3.c.c Gradient[60 x 60 x 1 x *]] [conv3.out Gradient[60 x 60 x 1 x *]] }
000000002D237340: {[conv2.c.c Gradient[60 x 60 x 128 x *]] [conv2.out Gradient[60 x 60 x 128 x *]] [conv3.cpb Gradient[60 x 60 x 1 x *]] }
000000002D2373E0: {[conv3.b.b Gradient[1 x 1 x 1]] }

the log section that shows the progression of training objective values? (Finished...ce=...)

Here it is (for a training rate of 0.01 per MB):

Starting Epoch 1: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 0: frames [0..6000] (first sequence at sample 0), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[ 1 of 15]: [Training] mse = 2975.58366667 * 6000; totalSamplesSeen = 6000; learningRatePerSample = 0.00024999998; epochTime=24.2631s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.1'

Starting Epoch 2: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 1: frames [6000..12000] (first sequence at sample 6000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[ 2 of 15]: [Training] mse = 2507.21150000 * 6000; totalSamplesSeen = 12000; learningRatePerSample = 0.00024999998; epochTime=21.0733s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.2'

Starting Epoch 3: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 2: frames [12000..18000] (first sequence at sample 12000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[ 3 of 15]: [Training] mse = 2507.21083333 * 6000; totalSamplesSeen = 18000; learningRatePerSample = 0.00024999998; epochTime=21.0034s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.3'

Starting Epoch 4: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 3: frames [18000..24000] (first sequence at sample 18000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[ 4 of 15]: [Training] mse = 2507.21083333 * 6000; totalSamplesSeen = 24000; learningRatePerSample = 0.00024999998; epochTime=20.9977s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.4'

Starting Epoch 5: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 4: frames [24000..30000] (first sequence at sample 24000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[ 5 of 15]: [Training] mse = 2507.21150000 * 6000; totalSamplesSeen = 30000; learningRatePerSample = 0.00024999998; epochTime=20.9965s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.5'

Starting Epoch 6: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 5: frames [30000..36000] (first sequence at sample 30000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[ 6 of 15]: [Training] mse = 2507.21100000 * 6000; totalSamplesSeen = 36000; learningRatePerSample = 0.00024999998; epochTime=20.9914s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.6'

Starting Epoch 7: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 6: frames [36000..42000] (first sequence at sample 36000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[ 7 of 15]: [Training] mse = 2507.21033333 * 6000; totalSamplesSeen = 42000; learningRatePerSample = 0.00024999998; epochTime=20.9897s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.7'

Starting Epoch 8: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 7: frames [42000..48000] (first sequence at sample 42000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[ 8 of 15]: [Training] mse = 2507.21100000 * 6000; totalSamplesSeen = 48000; learningRatePerSample = 0.00024999998; epochTime=21.0044s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.8'

Starting Epoch 9: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 8: frames [48000..54000] (first sequence at sample 48000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[ 9 of 15]: [Training] mse = 2507.21150000 * 6000; totalSamplesSeen = 54000; learningRatePerSample = 0.00024999998; epochTime=20.9976s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.9'

Starting Epoch 10: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 9: frames [54000..60000] (first sequence at sample 54000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[10 of 15]: [Training] mse = 2507.21066667 * 6000; totalSamplesSeen = 60000; learningRatePerSample = 0.00024999998; epochTime=21.0264s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.10'

Starting Epoch 11: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 10: frames [60000..66000] (first sequence at sample 60000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[11 of 15]: [Training] mse = 2507.21100000 * 6000; totalSamplesSeen = 66000; learningRatePerSample = 0.00024999998; epochTime=21.0257s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.11'

Starting Epoch 12: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 11: frames [66000..72000] (first sequence at sample 66000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[12 of 15]: [Training] mse = 2507.21066667 * 6000; totalSamplesSeen = 72000; learningRatePerSample = 0.00024999998; epochTime=21.0731s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.12'

Starting Epoch 13: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 12: frames [72000..78000] (first sequence at sample 72000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[13 of 15]: [Training] mse = 2507.21116667 * 6000; totalSamplesSeen = 78000; learningRatePerSample = 0.00024999998; epochTime=21.0335s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.13'

Starting Epoch 14: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 13: frames [78000..84000] (first sequence at sample 78000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[14 of 15]: [Training] mse = 2507.21116667 * 6000; totalSamplesSeen = 84000; learningRatePerSample = 0.00024999998; epochTime=21.05s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace.14'

Starting Epoch 15: learning rate per sample = 0.000250  effective momentum = 0.900000  momentum as time constant = 379.6 samples
BlockRandomizer::StartEpoch: epoch 14: frames [84000..90000] (first sequence at sample 84000), data subset 0 of 1

Starting minibatch loop.
Finished Epoch[15 of 15]: [Training] mse = 2507.21133333 * 6000; totalSamplesSeen = 90000; learningRatePerSample = 0.00024999998; epochTime=21.0296s
SGD: Saving checkpoint model '../Output/Models/03_FreeSpace'
CNTKCommandTrainEnd: train

pauldragan avatar Aug 26 '16 05:08 pauldragan

Hi Paul,

Did you try to increase wScale values ?

mfuntowicz avatar Aug 27 '16 10:08 mfuntowicz

OK, your model does not learn anything, that is clear. Few things I notice.

First, ReLUs can be fickle, especially when you mix ReLUs layers with large variation. This is because ReLUs are scale-preserving, and the gradients for the kernels or weight matrices depend on the scaling. If layers are of very different scales, your gradients will be as well. As a consequence, some layers will move very fast, while others are stuck. Especially since you go from a 128-dim representation to a scalar per pixel, I can see how that could be a problem.

Two remedies I can see:

  • try BatchNormalization.
  • check, and possibly adjust, initialization. CNTK 1.7, which is already available as master and will be built in binary on Monday, has more initialization options that use better defaults for scaling, as described here. The most common initialization for image-related tasks is init='heNormal'. This option does not exist before CNTK 1.7, but you can fake it in 1.6 by setting init='gaussian' with an initValueScale 7.07 time larger. You can try modifying Conv2DReLULayer() accordingly.

Second, I am not sure whether, at the very top of the stack, taking a ReLU per pixel and scoring that against image data (?) is the right thing to do, conceptually. Is this from a paper? My intuition is that a large number of ReLUs together can represent stuff, but once you go to the level of a single value, keeping the numeric value for only the positive side seems questionable. I would want to either force a decision (Softmax() or Sigmoid(); ReLUs only half-force a decision--for negative inputs) or do regression, for which I would use a non-squashed value.

frankseide avatar Aug 28 '16 02:08 frankseide

Thanks for your suggestions, Frank! I will try them as soon as possible next week.

Second, I am not sure whether, at the very top of the stack, taking a ReLU per pixel and scoring that against image data (?) is the right thing to do, conceptually. Is this from a paper?

No, it's not from a paper, but I thought it would be simple and that it should train to a certain extent (I also tried fitting from constant 0 to 1 and from 1 to 1, but no luck). I arrived to it after trying different setups, but all gave similar results. Sigmoid activations, for example, outputted the same value (0.43 or something like that) for each pixel (not constant input).

I am really looking forward to the 1.7 release, though. I also believe that the problem is caused mainly by poorly initialized weights.

pauldragan avatar Aug 28 '16 10:08 pauldragan

Try using gradient clipping. It worked for me on a similar (fully-convolutional) problem which would not converge otherwise. The reason why it helps (my intuition) is that the desired output is usually "sparse" (per feature map) but the random initialization produces very dense results, thus resulting in a large gradient especially for the first couple of minibatches, which pulls the weights quickly down to zero.

DanielMerget avatar Mar 29 '17 08:03 DanielMerget