Skip to content

Commit

Permalink
deleted the following nodes, as they are either redundant or currentl…
Browse files Browse the repository at this point in the history
…y not implemented correctly (but may come back in the future): StrideTimesNode, ParallelNode, LSTMNode, BatchModeNode, TimeReverseNode;

also sorted some of the lookup-table like functions (matching node names) alphabetically
  • Loading branch information
frankseide committed Jan 22, 2016
1 parent f419741 commit abd5206
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 3,504 deletions.
198 changes: 62 additions & 136 deletions Source/CNTK/NetworkDescriptionLanguage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,146 +150,72 @@ bool CheckFunction(std::string& p_nodeType, bool* allowUndeterminedVariable)
bool ret = false;
if (allowUndeterminedVariable)
*allowUndeterminedVariable = true; // be default we allow undetermined variables
if (EqualInsensitive(nodeType, OperationNameOf(InputValue), L"Input"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SparseInputValue), L"SparseInput"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(LearnableParameter), L"Parameter"))
ret = true;
else if (EqualInsensitive(nodeType, L"ImageParameter"))
ret = true;
//else if (EqualInsensitive(nodeType, OperationNameOf(SparseLearnableParameter), L"SparseParameter"))
// ret = true;
else if (EqualInsensitive(nodeType, L"Constant", L"Const"))
ret = true;
else if (EqualInsensitive(nodeType, L"ImageInput", L"Image"))
ret = true;
else if (EqualInsensitive(nodeType, L"SparseImageInput", L"SparseImage"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SumElementsNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SumColumnElementsNode)))
ret = true;
else if (EqualInsensitive(nodeType, L"Scale"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(TransposeNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(TimesNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(TransposeTimesNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(StrideTimesNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ElementTimesNode)))
ret = true;
else if (EqualInsensitive(nodeType, L"RowElementTimes"))
ret = true;
else if (EqualInsensitive(nodeType, L"ColumnElementTimes"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(DiagTimesNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(CosDistanceNode), L"CosDist"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(KhatriRaoProductNode), L"ColumnwiseCrossProduct"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(PlusNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(MinusNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(NegateNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(RectifiedLinearNode), L"ReLU"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SigmoidNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(TanhNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ExpNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(LogNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(CosineNode), L"Cos"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(HardmaxNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SoftmaxNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(LogSoftmaxNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SquareErrorNode), L"SE"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(LogisticNode), L"Logistic"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(CrossEntropyWithSoftmaxNode), L"CEWithSM"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SequenceWithSoftmaxNode), L"SEWithSM"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(CrossEntropyNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ClassBasedCrossEntropyWithSoftmaxNode), L"CBCEWithSM"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(MatrixL1RegNode), L"L1Reg"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(MatrixL2RegNode), L"L2Reg"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(PerDimMeanVarNormalizationNode), L"PerDimMVNorm"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(PerDimMeanVarDeNormalizationNode), L"PerDimMVDeNorm"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ErrorPredictionNode), L"ClassificationError"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(DropoutNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ReshapeNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(RowRepeatNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(DiagonalNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(MeanNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(InvStdDevNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ConvolutionNode), L"Convolve"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(MaxPoolingNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(AveragePoolingNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(PastValueNode), L"Delay"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(FutureValueNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(RowSliceNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(RowStackNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(LookupTableNode)))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(GMMLogLikelihoodNode), L"GMMLL"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(CosDistanceWithNegativeSamplesNode), L"CosWithNegSamples"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(TimeReverseNode), L"TimeReverse"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(CRFNode), L"CRF"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(DummyCriterionNode), L"DummyCriterion"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ParallelNode), L"Parallel"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(LSTMNode), L"LSTM"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(StrideTimesNode), L"StrideTimes"))
ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(BatchNormalizationNode)))
ret = true;
if (EqualInsensitive(nodeType, OperationNameOf(AveragePoolingNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(BatchNormalizationNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(CRFNode), L"CRF")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ClassBasedCrossEntropyWithSoftmaxNode), L"CBCEWithSM")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ConvolutionNode), L"Convolve")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(CosDistanceNode), L"CosDist")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(CosDistanceWithNegativeSamplesNode), L"CosWithNegSamples")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(CosineNode), L"Cos")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(CrossEntropyNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(CrossEntropyWithSoftmaxNode), L"CEWithSM")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(DiagTimesNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(DiagonalNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(DropoutNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(DummyCriterionNode), L"DummyCriterion")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ElementTimesNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ErrorPredictionNode), L"ClassificationError")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ExpNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(FutureValueNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(GMMLogLikelihoodNode), L"GMMLL")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(HardmaxNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(InputValue), L"Input")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(InvStdDevNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(KhatriRaoProductNode), L"ColumnwiseCrossProduct")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(LearnableParameter), L"Parameter")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(LogNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(LogSoftmaxNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(LogisticNode), L"Logistic")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(LookupTableNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(MatrixL1RegNode), L"L1Reg")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(MatrixL2RegNode), L"L2Reg")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(MaxPoolingNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(MeanNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(MinusNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(NegateNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(PastValueNode), L"Delay")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(PerDimMeanVarDeNormalizationNode), L"PerDimMVDeNorm")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(PerDimMeanVarNormalizationNode), L"PerDimMVNorm")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(PlusNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(RectifiedLinearNode), L"ReLU")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(ReshapeNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(RowRepeatNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(RowSliceNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(RowStackNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SequenceDecoderNode), L"SEWithSM")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SequenceWithSoftmaxNode), L"SEWithSM")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SigmoidNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SoftmaxNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SparseInputValue), L"SparseInput")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SquareErrorNode), L"SE")) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SumColumnElementsNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(SumElementsNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(TanhNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(TimesNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(TransposeNode))) ret = true;
else if (EqualInsensitive(nodeType, OperationNameOf(TransposeTimesNode))) ret = true;
else if (EqualInsensitive(nodeType, L"ColumnElementTimes")) ret = true;
else if (EqualInsensitive(nodeType, L"Constant", L"Const")) ret = true;
else if (EqualInsensitive(nodeType, L"ImageInput", L"Image")) ret = true;
else if (EqualInsensitive(nodeType, L"ImageParameter")) ret = true;
else if (EqualInsensitive(nodeType, L"RowElementTimes")) ret = true;
else if (EqualInsensitive(nodeType, L"Scale")) ret = true;
else if (EqualInsensitive(nodeType, L"SparseImageInput", L"SparseImage")) ret = true;

// return the actual node name in the parameter if we found something
if (ret)
{
p_nodeType = msra::strfun::utf8(nodeType);
}
return ret;
}

Expand Down
11 changes: 1 addition & 10 deletions Source/ComputationNetworkLib/ComputationNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ void ComputationNetwork::GetNodesRequiringX(list<ComputationNodeBasePtr>& nodesR
nodesRequiringX.unique();
}

//return list of nodes that require precomputation and not precomputed yet.
// return list of nodes that require precomputation and not precomputed yet
list<ComputationNodeBasePtr> ComputationNetwork::GetNodesRequiringPreComputation(const ComputationNodeBasePtr& rootNode, bool checkComputed)
{
list<ComputationNodeBasePtr> nodesRequiringX;
Expand All @@ -466,15 +466,6 @@ list<ComputationNodeBasePtr> ComputationNetwork::GetNodesRequiringPreComputation
return nodesRequiringX;
}

//return list of nodes that require batch mode and not precomputed yet.
list<ComputationNodeBasePtr> ComputationNetwork::GetNodesRequiringBatchMode(const ComputationNodeBasePtr& rootNode, bool checkComputed)
{
list<ComputationNodeBasePtr> nodesRequiringX;
GetNodesRequiringX<BatchModeNode<float>>(nodesRequiringX, rootNode, checkComputed);
GetNodesRequiringX<BatchModeNode<double>>(nodesRequiringX, rootNode, checkComputed);
return nodesRequiringX;
}

// create the m_inputValues[] and m_learnableParameters[] lists
void ComputationNetwork::CollectInputAndLearnableParameters(const ComputationNodeBasePtr& rootNode)
{
Expand Down
4 changes: 1 addition & 3 deletions Source/ComputationNetworkLib/ComputationNetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,8 @@ class ComputationNetwork : public ScriptableObjects::Object, public ScriptableOb
void GetNodesRequiringX(std::list<ComputationNodeBasePtr>& nodesRequirePreComputation, const ComputationNodeBasePtr& rootNode, bool checkComputed);

public:
//return list of nodes that require precomputation and not precomputed yet.
// return list of nodes that require precomputation and not precomputed yet
std::list<ComputationNodeBasePtr> GetNodesRequiringPreComputation(const ComputationNodeBasePtr& rootNode = nullptr, bool checkComputed = true);
//return list of nodes that require precomputation and not precomputed yet.
std::list<ComputationNodeBasePtr> GetNodesRequiringBatchMode(const ComputationNodeBasePtr& rootNode = nullptr, bool checkComputed = true);

// -----------------------------------------------------------------------
// unit testing
Expand Down
Loading

0 comments on commit abd5206

Please sign in to comment.