cntk

Defining a seed value in Branscripts for CNTK sequential machine learning models

陌路散爱 提交于 2019-12-12 23:34:32
问题 This is respect to CNTK brain scripts. I went through [1] to figure out whether there is an option to specify the random seed value, although I couldn't find any (Yes there is an option to set the 'random seed' parameter through the ParameterTensor() function, but if I followed that approach, I might have to explicitly initialize all the LSTM weights separately(defining separate weights for input layer gate, forget layer gate etc. ), instead of using the model sequence as below). Is there any

How to use RGB Image as input for the C# EvalDll Wrapper?

断了今生、忘了曾经 提交于 2019-12-12 15:41:44
问题 I trained a network using the provided ImageReader and now, I'm trying to use the CNTK EvalDll in a C# project to evaluate RGB Images. I've seen examples related to the EvalDll, but the input is always an array of float/double, never images. How can I use the exposed interface to use the trained network with an RGB image ? 回答1: I'll assume that you'll want the equivalent of reading with the ImageReader , where your reader config looks something like features=[ width=224 height=224 channels=3

How to verify the usage of the GPU?

孤街醉人 提交于 2019-12-12 09:39:21
问题 How can I verify that CNTK is using the GPU? I have installed the CNTK-2-0-beta7-0-Windows-64bit-GPU-1bit-SGD binaries on my machine. But, when I try to run this from Python: from cntk.device import set_default_device, gpu set_default_device(gpu(0)) I get: --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-8-eca77b3090be> in <module>() 1 from cntk.device import set_default_device, gpu ----> 2 set_default

cntk linear activation function in layers?

懵懂的女人 提交于 2019-12-11 07:37:12
问题 In CNTK, it has relu, hardmax, softmax, sigmoid and all that good stuff, but I'm building a regression based algorithm and the final layer needs to predict 2 or more regression outputs. So I need n nodes, and the activation be just a run of the mill linear activation. I see I can set the activation to None, is that in fact the correct thing? with cntk.layers.default_options(activation=cntk.ops.relu, pad=True): z = cntk.models.Sequential([ cntk.models.LayerStack(2, lambda : [ cntk.layers

CNTK python api - continue training a model

半城伤御伤魂 提交于 2019-12-11 06:18:24
问题 I have tried the example The example works fine. I can restart the training, but am unable to continue the training after a model has been trained. I have tried agent.brain.model.load_model('setBdqn.mod', False) but get an error message. 回答1: The error message says that the load_model function does not have 2 arguments. You need to change that to agent.brain.model.load_model('setBdqn.mod') I'm assuming that you changed the call to save_model to be agent.brain.model.save_model('setBdqn.mod',

Extremely basic neural network not learning

旧街凉风 提交于 2019-12-11 01:07:19
问题 I've gone through some of the CNTK Python tutorials and I'm trying to write an extremely basic one layer neural network that can compute a logical AND. I have functioning code, but the network isn't learning - in fact, loss gets worse and worse with each minibatch trained. import numpy as np from cntk import Trainer from cntk.learner import sgd from cntk import ops from cntk.utils import get_train_eval_criterion, get_train_loss input_dimensions = 2 # Define the training set input_data = np

how loss and metric are calculated in cntk

房东的猫 提交于 2019-12-10 21:14:07
问题 I am new to cntk and python. I have created a python program based on TrainResNet_CIFAR10.py to train 4736 of (64x64x3) images and test 2180 images with 4 classes. After train 160 epochs, I got loss = 0.663 and metric = 29.37%. Finished evaluation metric = 18.94%. When I evaluate the train model based on CNTKLibraryCSEvalExamples.cs to test 2180 images, almost all 2180 are classified as one class (second class). My questions are: I assume loss is calculated from cross_entropy_with_softmax(z,

How best to deal with “None of the above” in Image Classification?

南笙酒味 提交于 2019-12-09 10:58:52
问题 This seems to be a fundamental question which some of you out there must have an opinion on. I have an image classifier implemented in CNTK with 48 classes. If the image does not match any of the 48 classes very well, then I'd like to be able to conclude that it was not among these 48 image types. My original idea was simply that if the highest output of the final Softmax layer was low, I would be able to conclude that the test image matched none well. While I occasionally see this occur, in

CNTK python API: How to get predictions from the trained model?

元气小坏坏 提交于 2019-12-08 05:15:49
问题 I have a trained model which I am loading using CNTK.load_model() function. I was looking at the MNIST Tutorial on the CNTK git repo as reference for model evaluation code. I have created a data reader (which is a MinibatchSource object) and trying to run model.eval(mb) where mb = minibatch_source.next_minibatch(...) (Similar to this answer) But, I'm getting the following error message Traceback (most recent call last): File "LID_test.py", line 162, in <module> test_and_evaluate() File "LID

CNTK python API: How to get predictions from the trained model?

巧了我就是萌 提交于 2019-12-06 15:46:35
I have a trained model which I am loading using CNTK.load_model() function. I was looking at the MNIST Tutorial on the CNTK git repo as reference for model evaluation code. I have created a data reader (which is a MinibatchSource object) and trying to run model.eval(mb) where mb = minibatch_source.next_minibatch(...) (Similar to this answer ) But, I'm getting the following error message Traceback (most recent call last): File "LID_test.py", line 162, in <module> test_and_evaluate() File "LID_test.py", line 159, in test_and_evaluate predictions = model.eval(mb) File "/home/t-asbahe/anaconda3