cntk

possible std::async implementation bug Windows

你离开我真会死。 提交于 2020-01-02 12:14:10
问题 It seems like there is a bug in the windows implementation of std::async. Under heavy load (on the order of 1000 threads launched async per second), async tasks are never scheduled and waiting on the returned futures leads to deadlocks. See this piece of code (modified with launch policy deferred instead of async): BundlingChunk(size_t numberOfInputs, Bundler* parent, ChunkIdType chunkId) : m_numberOfInputs(numberOfInputs), m_parent(parent), m_chunkId(chunkId) { const BundlerChunkDescription&

CNTK: how do I create a sequence of tensors from a single tensor?

拥有回忆 提交于 2020-01-01 19:44:20
问题 I have a working TensorFlow seq2seq model I've been using for image captioning that I'd like to convert over to CNTK, but I'm having trouble getting the input to my LSTM in the right format. Here's what I do in my TensorFlow network: max_seq_length = 40 embedding_size = 512 self.x_img = tf.placeholder(tf.float32, [None, 2048]) self.x_txt = tf.placeholder(tf.int32, [None, max_seq_length]) self.y = tf.placeholder(tf.int32, [None, max_seq_length]) with tf.device("/cpu:0"): image_embed_inputs =

eval and test_minibatch in cntk

北慕城南 提交于 2019-12-24 11:42:18
问题 We are using TrainResNet_CIFAR10.py as an example to learn cntk. We have created two methods, eval_metric and calc_error as below: def eval_metric(trainer, reader_test, test_epoch_size, label_var, input_map) : # Evaluation parameters minibatch_size = 16 # process minibatches and evaluate the model metric_numer = 0 metric_denom = 0 sample_count = 0 while sample_count < test_epoch_size: current_minibatch = min(minibatch_size, test_epoch_size - sample_count) # Fetch next test min batch. data =

CNTK Complaining about Dynamic Axis in LSTM

别来无恙 提交于 2019-12-23 07:28:10
问题 I'm trying to implement an LSTM in CNTK (using Python) to classify a sequence. Input: Features are fixed length sequences of numbers (a time series) Labels are vectors of one-hot values Network: input = input_variable(input_dim) label = input_variable(num_output_classes) h = Recurrence(LSTM(lstm_dim)) (input) final_output = C.sequence.last(h) z = Dense(num_output_classes) (final_output) loss = C.cross_entropy_with_softmax(z, label) Output: A probability that the sequence matches a label All

CNTK c# logistic regression w and b variable values

僤鯓⒐⒋嵵緔 提交于 2019-12-22 10:58:13
问题 I know CNTK for C# is kind of new but I hope someone can help me out. I was folling this logistic regression example in python: https://github.com/Microsoft/CNTK/blob/master/Tutorials/CNTK_101_LogisticRegression.ipynb to run this C# example: https://github.com/Microsoft/CNTK/blob/master/Examples/TrainingCSharp/Common/LogisticRegression.cs I changed a few lines to display the result and the code runs without errors but I would like to get the values of the weight matrix and bias vector so I

Keras-CNTK saving model-v2 format

两盒软妹~` 提交于 2019-12-22 08:19:42
问题 I'm using CNTK as the backend for Keras. I'm trying to use my model which I have trained using Keras in C++. I have trained and saved my model using Keras which is in HDF5. How do I now use CNTK API to save it in their model-v2 format? I tried this: model = load_model('model2.h5') cntk.ops.functions.Function.save(model, 'CNTK_model2.pb') but i got the following error: TypeError: save() missing 1 required positional argument: 'filename' If tensorflow were the backend I would have done this:

Add CNTK virtualenv to Visual Studio Python project

心已入冬 提交于 2019-12-14 03:19:48
问题 I followed Setup CNTK on Windows, and confirmed that I can run CTNK from my local command prompt. C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py34>.\Scripts\activate.bat (root) C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py34>set PATH=C:\local\CNTK-2-0-beta3-0-Windows-64bit-CPU-Only\cntk\cntk;%PATH% (root) C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py34>python -i Python 3.4.4 |Continuum Analytics, Inc.| (default, Jun 15 2016, 15:25:08) [MSC v.1600 64 bit (AMD64)] on win32

What is the CNTK way to convert a vector that contains labels as indices to a one hot-representation?

馋奶兔 提交于 2019-12-13 16:40:44
问题 In CNTK I need a way to convert a vector that contains labels as indices (just a regular vector, not a sparse representation) to a one hot-representation. Here is an example for 5 classes: Input [2, 0, 1, 1] Desired output: [[0,0,1,0,0], [1,0,0,0,0], [0,1,0,0,0], [0,1,0,0,0]] Is there a way without going through Python/numpy? 回答1: The ‘Value.one_hot’ method does this (converts to a sparseCSC matrix representation internally). https://www.cntk.ai/pythondocs/cntk.html?highlight=one_hot#cntk

How to access trained parameters in CNTK 2.2 C# API

末鹿安然 提交于 2019-12-13 03:48:49
问题 I'm getting to know the new CNTK 2.2 C# API which allows training models from C# as well. I managed to get sample program working, but was wondering how I can access the trained parameter values after training. Found good examples for Python, but none for C#. Can anyone help or point me in the right direction please? Thanks! 来源: https://stackoverflow.com/questions/46653960/how-to-access-trained-parameters-in-cntk-2-2-c-sharp-api

CNTK C# API - How to set learner module and number of iteration in learner module for training

放肆的年华 提交于 2019-12-12 23:44:40
问题 I am using CNTK C# API (Latest 2.2 release) and have following questions. (using the logisticsRegression example from GitHub and modifying it to set it for my usecase. Using SGD and also tried SGDMomentim learners. 1. How can I set number of max iteration per sample for training. I can see LR and MR variables in SGDMomentum but nothing for iterations. 2. Is there a way to monitor how each neuron is progressing/stuck as training progresses thru each sample per iteration in the network. Or how