Skip to content
Snippets Groups Projects
Commit 104f5a9b authored by Van Dung NGUYEN's avatar Van Dung NGUYEN
Browse files

new

parent 2e8ae367
No related branches found
No related tags found
1 merge request!309Master
......@@ -244,7 +244,7 @@ void Tree::createSpecialTripleTree(int numNodes, int numDirVars, const std::stri
}
};
void Tree::createRandomTreeSameDepthForNodes(int nbLeaves, int numChildMax, int leafPerNode, int numDirVars,const std::string affunc, bool randomChild)
void Tree::createRandomTreeSameDepthForNodes(int nbLeaves, int numChildMax, int leafPerNode, int numDirVars,const std::string affunc, bool randomChild, bool randomMat)
{
auto makeGroup = [&](const std::vector<int>& input, std::vector<int>& outPut, bool first)
{
......@@ -269,7 +269,7 @@ void Tree::createRandomTreeSameDepthForNodes(int nbLeaves, int numChildMax, int
if (first)
{
numChilds = leafPerNode;
if (randomChild)
if (randomMat)
{
numChilds = rand() % (leafPerNode-1) + 2; // number takes a random value from 2 to leafPerNode
}
......
......@@ -53,7 +53,7 @@ class Tree
void createPerfectTree(int maxDepth, int numChildRegular, int numChildLeaf, int numDirVars, const std::string affunc="relu", int lastRepeat=1);
void createMixedTree(int maxDepth, int numChildMax, int leafPerNode, int numDirVars,const std::string affunc="relu");
void createRandomTree(int nbLeaves, int numChildMax, int leafPerNode, int numDirVars,const std::string affunc="relu", bool randomSubdivion=true, bool randomChild=true, bool sameNbChildLayer=true);
void createRandomTreeSameDepthForNodes(int nbLeaves, int numChildMax, int leafPerNode, int numDirVars,const std::string affunc="relu", bool randomChild=true);
void createRandomTreeSameDepthForNodes(int nbLeaves, int numChildMax, int leafPerNode, int numDirVars,const std::string affunc="relu", bool randomChild=true, bool randomMat=true);
void createSpecialBinaryTree(int numNodes, int numDirVars,const std::string affunc="relu");
void createSpecialTripleTree(int numNodes, int numDirVars,const std::string affunc="relu");
void printTree() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment