Граф коммитов

881 Коммитов

Автор SHA1 Сообщение Дата
Amit Agarwal 62558e3079 Moved the parallel trainign guard when writing model/checkpoint files to the actual save functions instead of guarding at the call sites 2015-09-15 21:04:09 -07:00
Frank Seide d204e2d11e (made gcc happy) 2015-09-14 22:13:56 +02:00
Frank Seide fa6816419c moved most parts of BrainScriptEvaluator.h (those that are now independent of BrainScript) to BrainScriptObjects.h, and then renamed it ScriptableObjects.h;
also changed the namespace of all inside ScriptableObjects to Microsoft::MSR::ScriptableObjects;
NetworkBuilderFromConfig.cpp (the one that creates objects from BrainScript) also moved to ScriptableObjects namespace. It is independent of BrainScript now--yay! Python, F#, come all in!;
added a new base class ScriptableObjects::ScriptingError for catching and printing scripting exceptions
2015-09-14 21:38:45 +02:00
Frank Seide ffb3d1de7a made BrainScriptEvaluator.h independent of BrainScriptParser.h, in prep of separating out ConfigValue, ConfigRecord, ConfigArray, and ConfigLambda from BrainScript so that they can be used by other language wrappers as well. This required to replace ConfigValuePtr::textLocation by a lambda that prints an error string, annotated with a text location hidden inside the lambda (think Python wrapper--the lambda knows how to pinpoint the location in the Python source). Instead of throwing EvaluationError(msg, val.GetTextLocation()), one now instead says val.Fail(msg);
EvaluationError itself is now encapsulated inside BrainScriptEvaluator.cpp;
deleted IConfigRecord::operator(), as it was not really useful. Just use operator[]
2015-09-14 20:19:35 +02:00
Frank Seide 730a398c4d reimplemented {{Runtime,Logic}Error,InvalidArgument}() using a common base function to remove code dup 2015-09-11 13:54:22 +02:00
Frank Seide 62f5e30932 replaced all throw std::xxx_error with corresponding call to XXXError(), likewise for invalid arg 2015-09-11 13:36:23 +02:00
Frank Seide b36963f056 removed 46 duplicated calls to PrintSelfBeforeValidation(), instead calling it at once place from validation loop;
Validate() is now no longer pure, two nodes have no Validate() anymore, all others call Base::Validate() first
2015-09-11 13:28:58 +02:00
Frank Seide a59291889d fixed CNTKEvalTest build, was still using old name of Math lib 2015-09-11 13:01:44 +02:00
Frank Seide 09fc3fe6bb reviewed & fixed more uses of ColumnSlice(), there is no obvious case missing, but some more tricky cases are left, which are commented in the FrameRange class definition and require further thought 2015-09-11 12:58:29 +02:00
Frank Seide 1c1507b267 reviewed remaining ColunmSlice() calls in RecurrentNodes & fixed where appropriate 2015-09-11 12:46:52 +02:00
Frank Seide c0d58d373d changed some uncalled-for use of 'long' to 'size_t' 2015-09-11 12:31:12 +02:00
Frank Seide da6ffb3b18 simplified some error throws by using that LogicError() takes printf-like arguments;
sorted code order a bit (ComputeInputPartialOverXXX() moved)
2015-09-11 12:27:26 +02:00
Frank Seide 05f75b26b4 changed a use of ColumnSlice() to FrameSlice() in BatchModeNode;
cleaned up UsingBatchModeNodeMembers macro;
factored the 99% identical Max/AveragePoolingNode classes into shared PoolingNodeBase;
removed use of static eval/partial functions for convolution nodes, allowing to eliminate the detour via ConvolutionParams and PoolParams algogether, saving more code;
removed redundant member copies in CopyTo() of pooling node (-base, now), that is, members that are already copied in ComputationNode::CopyTo()
2015-09-11 12:22:21 +02:00
Amit Agarwal c0a82795f5 Minor change to the synchronization conditions for parallel training to support non-parallel and parallel phases within the same run 2015-09-09 15:51:28 -07:00
Amit Agarwal 4e6ebb035e Merge branch 'master' of https://git01.codeplex.com/cntk into amitaga/fixLinuxMultiMachineTrainingIssue
Conflicts:
	MachineLearning/CNTKSGDLib/AllReduceDistGradAggregator.h
	MachineLearning/CNTKSGDLib/IDistGradAggregator.h
	MachineLearning/CNTKSGDLib/SGD.cpp
2015-09-09 11:50:29 -07:00
Amit df80b5b127 Worked around a bug in OpenMPI implementation where it reports completion of a receive to a CUDA page-locked buffer even when no data is really written to the buffer 2015-09-09 11:24:24 -07:00
Amit e3ade64368 Added some more debug spew for debugging gradient aggregation code during parallel training 2015-09-09 10:37:15 -07:00
Frank Seide 473a8356b8 Split off two separately-built libs from main CNTK project: CNTKComputationNetworkLib and CNTKSGDLib. These have their own directories now, and their include paths only include libs below (but not the CNTK project, for example), enforcing some modularization.
Changed some scalar numerical values from ElemType to double, where this distinction did not add value, for example for objective values, frame-error rates, and learning rates.

Lots of minor cleanup such as reducing header dependencies (e.g. Matrix.h), consistency of template<typename/class ElemType>, and moved some misplaced code to more appropriate places (e.g. LearnableParameter initializations).

Merge branch 'master' into fseide/netlib

Conflicts:
	MachineLearning/CNTK/CNTK.cpp
2015-09-08 16:32:59 -07:00
Amit 9037583fb0 Fixed a crash on Linux 2015-09-08 12:23:18 -07:00
Frank Seide f86562de3b somehow screwed up lib directory path for CNTKEval.dll--fixed 2015-09-06 11:55:51 -07:00
Frank Seide a2e66c0733 missed stdafx etc in repo 2015-09-06 18:29:07 +02:00
Frank Seide 9aecb5649d made gcc happy again (mostly missing headers or wrong declaration orders);
Makefile adapted to new paths, but not yet building Network and SGD as separate libs
2015-09-06 09:20:28 -07:00
Frank Seide e2d567548c Matrix.h now no longer pulls in the CPU/GPUMatrix headers (this required cleaning up a few incorrect header dependencies as well);
cleaned up <class ElemType> vs. <typename ElemType> (using class since that was used more often, causing less diffs)
2015-09-06 17:17:07 +02:00
Frank Seide a48d1ae4f2 added comments on further disentangling this for BrainScript and Matrix;
updated the post-build event of CNTKEval to not fail in CPU-only builds
2015-09-06 06:14:47 +02:00
Frank Seide 9c31c21478 InitLearnableParametersFromFile() moved out of ComputationNetwork into LearnableParameter itself, there called InitFromFile();
renamed LoadArrayFromFile() to LoadMatrixFromFile() since that's what it does and means, even if it passes it on temporarily as a flattened array
2015-09-05 17:28:27 +02:00
Frank Seide b39f6da12c moved LoadArrayFromTextFile() from ComputationNetwork.h to File.h (it fits only a little better there) 2015-09-05 16:30:19 +02:00
Frank Seide 5e8182e2e4 fixed CNTKEval after the last changes 2015-09-05 14:11:58 +02:00
Frank Seide 0d9a5b8f7a (comments) 2015-09-05 13:57:27 +02:00
Frank Seide 39b7798c41 moved DecimateMinibatch functions to CPP 2015-09-05 13:49:40 +02:00
Frank Seide ceec2cf610 renamed a VS filter and added a few comments 2015-09-05 12:05:36 +02:00
Frank Seide ebc34473c3 moved IComputationNetBuilder.h over to CNTKSGDLib, as it is the interface through which models are either created or loaded from check-point 2015-09-05 11:28:24 +02:00
Frank Seide f3a1484246 renamed CNTKEval and CNTKMath by appending -Dll to their name 2015-09-05 11:18:44 +02:00
Frank Seide e4507e8700 CNTK now delay-loads msmpi.dll in case it is not installed;
moved Profiled.cpp/h;
disabled MultiNetworksSGD--seems not missing, not used
2015-09-05 11:16:55 +02:00
Frank Seide 75dd81795f moved stuff out from CNTK to CNTKSGDLib;
created an SGD.cpp that instantiates the exported classes of CNTKSGDLib;
does not build since git mixed up files during move, and it won't let me git-add and git-mv in one go
2015-09-05 11:00:51 +02:00
Frank Seide 066d9c8966 fixed project files after moving node/network sources over;
forgot to git-add the new file of previous check-in
2015-09-05 01:11:45 -07:00
Frank Seide c6499a4328 moved sources to CNTKComputationNetworkLib (will fix VS projects next) 2015-09-05 01:03:40 -07:00
Frank Seide c8da414d16 split ExperimentalNetworkBuilder.cpp up by moving out the actual node/network-creation code (which does not need to know ExperimentalNetworkBuilder.h) to new file NetworkBuilderFromConfig.cpp 2015-09-05 00:56:40 -07:00
Frank Seide 34beb6fdd7 updated CNTKEval w.r.t. network lib 2015-09-05 00:44:16 -07:00
Frank Seide 8887fc504f removed all CPP files of ComputationNetwork from CNTK project 2015-09-05 00:40:20 -07:00
Frank Seide 5e30ea7f04 changed XXX<float>::TypeName() to OperationNameOf(XXX) 2015-09-05 00:35:44 -07:00
Frank Seide 80ff5ab54f changed several scalar values from ElemType to double, including all objective values, error metrics, learning rates, dropout rate, adaptation weights etc., to eliminate more <ElemType> depnedency;
DistGradHeader no longer depending on <ElemType>;
all accesses of ComputationNode::TypeName are now done to <float> variant instead of <ElemType>, for consistency where we don't have an <ElemType>
2015-09-05 00:21:53 -07:00
Frank Seide 48d9807f79 and deleted ComputationNetworkHelper.h--one more down! 2015-09-04 23:05:49 -07:00
Frank Seide 67bb135b32 eliminated ComputationNetworkHelper--it was a base class that contained a few evaluation helpers that support forward prop, they may equally well belong into ComputationNetwork directly;
also, made two of three independent of ElemType
2015-09-04 23:04:00 -07:00
Frank Seide 2b2237e712 now linking with CNTKComputationNetworkLib, removed one CPP from CNTK proper for testing 2015-09-04 22:39:46 -07:00
Frank Seide 74fea06b72 selected which files go into the network lib 2015-09-04 20:12:24 -07:00
Jasha Droppo 04b7101903 Revert "Win32 CNTK.exe added control-c handler to wrap checkpoint file writing. If checkpoint file gets corrupted, then entire training run may be ruined."
This reverts commit 9b212d7783.
2015-09-04 19:53:41 -07:00
Frank Seide 89aec3fe20 added a new projec to hold computation-network related stuff as a library, not yet an actual library 2015-09-04 19:42:56 -07:00
Jasha Droppo ef8445a7b5 Win32 CNTK.exe added control-c handler to wrap checkpoint file writing. If checkpoint file gets corrupted, then entire training run may be ruined. 2015-09-04 19:35:11 -07:00
Frank Seide a3f0341a4d made ComputationNetwork independent of <ElemType>, aiming to make it easier to expose this as an interface in the future. In particular, all methods that still depended on <ElemType> got their own template parameter;
some spelling errors renamed (RequirePreCompute() -> RequirePreCompute(), same for BatchMode, and similarly for GetNodesRequiringPreComputation())
2015-09-03 21:18:13 -07:00
Frank Seide a09d05c798 merged fseide/bs feature branch:
Added a completely new configuration language, which currently can be used in place of NDL, but eventually will power all configurations.
It supports infix expressions, recursive macros, arrays, and a few useful functions such as string replace.
It is called "BrainScript" (file extension .bs), where the name is meant to be reflective of our grand ambition
(whereas the file extension is reflective of where we stand today w.r.t. that grand ambition...).
As of now, BrainScript can be accessed for configuring networks through the new ExperimentalNetworkBuilder option.
A few ComputationNodes are still missing, and MEL may not work as node naming is not sorted out yet.

The core classes were refactored aiming at removing the pervasive template parameter <ElemType> (selecting float vs. double), aiming at making it feasible to wrap parts of CNTK as libraries.
ComputationNode has been disentanlgled, while consumers such as ComputationNetwork and SGD--which really should be agnostic to float/double--have been changed to use the agnostic interface (ComputationNodeBase) where possible, but the full separation will require many more steps.
Theoretically, once this is completed, it would be possible to mix float and double nodes in a single graph (through the use of still to be written typecast nodes).

The two variants of each Evaluate and ComputePartial have been unified across full-minibatch and per-frame operation through passing the range as a new FrameRange object that encodes both whether it is the full minibatch vs. single frame, as well as the number of slices in a minibatch.
Currently, the latter is passed through a member m_samplesInRecurrentStep, which now can be removed (currently it is kept for a runtime check to verify that this was done right--to be removed).

The LSTM test case was modified to initialize its parameters with CPU code that, unlike the GPU code, honors random seeds, making it resilient to evaluation-order changes (that BrainScript implies, for example).
The test case now has a BrainScript implementation (it is not default though; default remains the NDL version).

Further minor code refactoring.
2015-09-03 19:35:17 -07:00