-
Notifications
You must be signed in to change notification settings - Fork 4.3k
CNTK_2_0_RC_1_Release_Notes
With Release Candidate 1 the Microsoft Cognitive Toolkit enters the final set of enhancements before release of the production version of CNTK v.2.0. We expect no breaking changes before the release of the production version, but we are eager to hear your feedback!
This Release contains all new features and improvements we have introduced in the set of v.2.0 Beta Releases.
We have summarized what was done during CNTK v.2.0 Beta period in this Wiki article.
This release contains the following breaking changes:
- New file names of CNTK Shared Libraries. Read more in this Wiki article.
- This is important for developers and other users who use explicit CNTK Shared Library file names in their solutions.
- If you are using CNTK NuGet packages for C++ or C# no action is required (beside updating to the latest NuGet package)
- There is a set of breaking changes in Python and C# API. See the correspondent sections below.
- Improved performance and memory footprint in CSC/CSR sparse matrix operations.
- Caffe-converted pretrained models on image classification including AlexNet, ResNet, VGG and BN-Inception.
- Multiple-axis slicing.
- Improvements in the device selection API (specifying excluded devices, querying device properties, locking device exclusively).
- Limit the number of sweeps for training.
We enabled support for model debugging in Python (similar to gdb/pdb) by wrapping the model with debug_model()
Read more here.
This release contains the following breaking changes in CNTK Python API:
- Automatic conversion to NumPy array via
np.asarray(cntk_obj)
is being replaced byasarray()
/as_sequences()
methods on those objects- Reasons:
-
np.assarray()
always returns NumPy arrays, so no sequences could be supported -
np.assarray()
only supports dense arrays -
np.assarray()
does not allow to throw exceptions from within the array interface
-
- Solution:
-
asarray()
returns dense or sparse (instance ofscipy.csr_matrix
) versions of the underlying data- supported by
Constant
,Parameter
,NDArrayView
,Value
, andMinibatchData
- supported by
-
as_sequences(var)
returns a Python list of sequences whose elements are NumPy arrays (according to var's dynamic and static axes)- supported by
Value
andMinibatchData
- supported by
-
- Reasons:
-
forward()
andeval()
behave more consistent now- Before: when the returned result did had sequences all of same length, they would be returned as a single NumPy array.
- Now: independent of the sequences, the result will always be a list if the output has a sequence axis. This will impact every usage that has the sequence axis in the output variable (e.g. if you just used
input_variable()
with standard settings and did not get rid of the sequence axes before the final output node).
-
MinibatchData.value
is deprecated now because of performance issues- Replacement: use
MinibatchData.data
, which returns aValue
instance that does not need to be converted before passing it to the Trainer and thus is much faster.
- Replacement: use
- Deprecated parameters were removed from
training_session
. The progress printer should be now passed directly to the trainer, not to the training session. To configure different aspects of the training session, please use configuration objects. In the new version CNTK supports:- checkpoint configuration
- cross validation configuration
- test configuration
- Support of CSC Sparse input.
- More flexible interface types in API to provide more freedom for developers.
- Improved CLS compliance to better support other .NET languages.
- Performance optimizations.
- Multiple bug fixes, including memory safety and concurrent evaluations.
The updated APIs are described in this Wiki page.
This release contains the following breaking changes in CNTK C# API:
- The following C# APIs have been moved to new classes:
-
CNTKLib.Alias()
->Function.Alias()
-
CTNKLib.AsComposite()
->Function.AsComposite()
-
CNTKLIb.Combine()
->Function.Combine()
-
CNTKLib.SetMaxNumCPUThreads()
->Utils.SetMaxNumCPUThreads()
-
CNTKLib.GetMaxNumCPUThreads()
->Utils.GetMaxNumCPUThreads()
-
- We have the following two groups of API changes due to signature simplification and certain type changes. These changes may require adaptations in dependent applications.
- Class
NDShape
public NDShape(int numAxes, int dimension)
public NDShape(int numAxes)
public int Rank { get; }
public IList<int> Dimensions { get; }
public int TotalSize { get; }
public int this[int key] { get; }
public NDShape SubShape(int beginAxisId, int endAxisId)
public NDShape SubShape(int beginAxisId)
public static NDShape CreateNDShape(IEnumerable<int> dimensions)
- Class
DeviceDescriptor
public int Id { get; }
public static DeviceDescriptor GPUDevice(int deviceId)
- Class
NDArrayView
public NDArrayView(NDShape viewShape, float[] dataBuffer, DeviceDescriptor device, bool readOnly = false)
public NDArrayView(NDShape viewShape, double[] dataBuffer, DeviceDescriptor device, bool readOnly = false)
public NDArrayView(NDShape viewShape, int[] colStarts, int[] rowIndices, float[] nonZeroValues, DeviceDescriptor device, bool readOnly = false)
public NDArrayView(NDShape viewShape, int[] colStarts, int[] rowIndices, double[] nonZeroValues, DeviceDescriptor device, bool readOnly = false)
- Class
NDMask
public int MaskedCount { get; }
public void InvalidateSection(IEnumerable<int> sectionOffset, NDShape sectionShape)
public void MarkSequenceBegin(IEnumerable<int> offset)
public void MarkSequenceBegin(IEnumerable<int> offset, NDShape sectionShape)
- Class
Value
public int MaskedCount { get; }
public static Value CreateBatch<T>(int dimension, IEnumerable<int> batch, DeviceDescriptor device, bool readOnly = false)
public static Value CreateSequence<T>(int dimension, IEnumerable<int> sequence, DeviceDescriptor device, bool readOnly = false)
public static Value CreateSequence<T>(int dimension, IEnumerable<int> sequence, bool sequenceStartFlag, DeviceDescriptor device, bool readOnly = false)
public static Value CreateBatchOfSequences<T>(int dimension, IEnumerable<IEnumerable<int>> batchOfSequences, DeviceDescriptor device, bool readOnly = false)
public static Value CreateBatchOfSequences<T>(int dimension, IEnumerable<IEnumerable<int>> batchOfSequences, IEnumerable<bool> sequenceStartFlags, DeviceDescriptor device, bool readOnly = false)
public static Value Create<T>(int dimension, IEnumerable<IEnumerable<int>> sequences, IEnumerable<bool> sequenceStartFlags, DeviceDescriptor device, bool readOnly = false)
- Class
Function
public IList<Variable> Arguments { get; }
public IList<Variable> Outputs { get; }
- Class
Variable
public IList<Axis> DynamicAxes { get; }
- Class
Value
public static Value CreateBatch<T>(NDShape sampleShape, IEnumerable<T> batch, DeviceDescriptor device, bool readOnly = false)
public static Value CreateSequence<T>(NDShape sampleShape, IEnumerable<T> sequence, DeviceDescriptor device, bool readOnly = false)
public static Value CreateSequence<T>(NDShape sampleShape, IEnumerable<T> sequence, bool sequenceStartFlag, DeviceDescriptor device, bool readOnly = false)
public static Value CreateBatchOfSequences<T>(NDShape sampleShape, IEnumerable<IEnumerable<T>> batchOfSequences, DeviceDescriptor device, bool readOnly = false)
public static Value CreateBatchOfSequences<T>(NDShape sampleShape, IEnumerable<IEnumerable<T>> batchOfSequences, IEnumerable<bool> sequenceStartFlags, DeviceDescriptor device, bool readOnly = false)
public static Value Create<T>(NDShape sampleShape, IEnumerable<IEnumerable<T>> sequences, IEnumerable<bool> sequenceStartFlags, DeviceDescriptor device, bool readOnly = false)
public static Value Create<T>(NDShape sampleShape, IEnumerable<IEnumerable<int>> sequences, IEnumerable<bool> sequenceStartFlags, DeviceDescriptor device, bool readOnly = false)
public static Value Create(NDShape sampleShape, IEnumerable<NDArrayView> sequences, DeviceDescriptor device, bool readOnly = false)
public static Value Create(NDShape sampleShape, IEnumerable<NDArrayView> sequences, IEnumerable<bool> sequenceStartFlags, DeviceDescriptor device, bool readOnly = false)
A new set of NuGet Packages is provided with this Release.
IMPORTANT! In Visual Studio Manage Nuget Packages Window change the default option Stable Only to Include Prerelease. Otherwise the packages will not be visible. The Package version should be 2.0.0-rc1
.