deploy
mac:/Users/yaroslav/Google Drive/src/gradient-checkpointing/treeDecomposition.nb
Mon 27 Nov 2017 18:57:24

Init


Test

g=GridGraph[{2,4},GraphStyle"DiagramBlue"];​​g​​target={{{1,2,3},{2,3,4},{3,4,5},{4,5,6},{5,6,7},{6,7,8}},{{{1,2,3},{2,3,4}},{{2,3,4},{3,4,5}},{{3,4,5},{4,5,6}},{{4,5,6},{5,6,7}},{{5,6,7},{6,7,8}}}};​​initAndRunDecomposition[g];​​(*Todo:renamebagstojbags*)​​jbagsFirst[target];​​jedges=Last[target];​​checkTreeDecomposition[jbags,jedges];​​getCost[n_]:=(​​g=GridGraph[{2,n},GraphStyle"DiagramBlue"];​​initAndRunDecomposition[g];​​getTreeCost[{jbags,jedges}]​​)​​ListPlot[getCost/@Range[10]]​​​​g=GridGraph[{2,4}];​​initAndRunDecomposition[g];​​drawBagOnGraph/@jbags​​​​(*testdirecteddecomposition*)​​resnet=Graph[{12,13,23,34,35,45,56,57,67,78,79,89,910,911,1011}];​​initAndRunDecomposition[resnet,True];​​GraphicsGrid[{drawBagOnGraph/@jbags},ImageSize400]
2
4
6
8
10
50
100
150
200
250

Thick chain decomposition


,
,
,
,
,


Resnet decomposition

​

Grid decomposition

initGraph[{"Grid",{3,3}}]​​Dynamic[drawBags[],TrackedSymbols{bags}]
drawBags[]
visGraph[]

Polyiamond decomposition

Resnet 18 decomposition