Evaluating cells such as

i = NetEncoder[{"Image", {64, 64}, ColorSpace -> "Grayscale"}]
  ConvolutionLayer[32, 5],
  }, "Input" -> i]

always produces

enter image description here enter image description here

where as what I need is the open view

enter image description here enter image description here

, at least for the NetChain.

Is there a way to always display full details?


1 Answer 1


For neural networks, you can do

NeuralNetworks`Private`$ExpandNetSummaryBoxByDefault = True;

to open them by default.

For most other types of summary boxes, you can use the following:

prot = Unprotect@BoxForm`ArrangeSummaryBox;
DownValues@BoxForm`ArrangeSummaryBox = DownValues@BoxForm`ArrangeSummaryBox /.
      {open_ = False, rest__},
      ] :> DynamicModule[
     {open = True, rest},
Protect /@ prot

This changes the default state of the generated boxes from closed to open.

  • $\begingroup$ Is there a way of doing this for any summary box without messing with its internals? I am ok to evaluate an additional function on a closed result each time. $\endgroup$
    – Cetin Sert
    Dec 9, 2019 at 21:53
  • $\begingroup$ As far as I know, no. The issue is that the state is stored inside a DynamicModuleBox, and I don't thinks it's feasible to get the variable and set it after the fact, without even worse messing with the front-end internals... $\endgroup$
    – Lukas Lang
    Dec 9, 2019 at 22:04
  • 2
    $\begingroup$ @CetinSert you can add a formatting wrapper that would introduce this rule only temporarily. Basically define some function: MakeBoxes[OpenedSummaryBoxes[e], form_]:=Internal`InheritedBlock[{BoxForm`ArrangeSummaryBox}, <<lucas's code >>; MakeBoxes[e, form] $\endgroup$
    – b3m2a1
    Dec 10, 2019 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.