@@ -64,7 +64,7 @@ MarianMT (encoder-decoder): [[Notebook]](notebooks/model_view_encoder_decoder.ip
6464The * neuron view* visualizes the individual neurons in the query and key vectors and shows how they are used to compute attention.
6565
6666🕹 Try out this [ interactive Colab Notebook] ( https://colab.research.google.com/drive/1m37iotFeubMrp9qIf9yscXEL1zhxTN2b )
67- with the neuron view pre-loaded (requires Chrome) .
67+ with the neuron view pre-loaded.
6868
6969![ neuron view] ( https://github.com/jessevig/bertviz/raw/master/images/neuron-view-dark.gif )
7070
@@ -221,38 +221,39 @@ cd bertviz
221221python setup.py develop
222222```
223223
224- ### Advanced options
224+ ### Additional options
225+
226+ #### Dark / light mode
227+
228+ The model view and neuron view support dark (default) and light modes. You may set the mode using
229+ the ` display_mode ` parameter:
230+ ```
231+ model_view(attention, tokens, display_mode="light")
232+ ```
233+
225234
226235#### Filtering layers
227236
228237To improve the responsiveness of the tool when visualizing larger models or inputs, you may set the ` include_layers `
229238 parameter to restrict the visualization to a subset of layers (zero-indexed). This option is available in the head view and model
230239view.
231240
232- ** Example:** Render model view with only layers 5 and 6 displayed:
241+ ** Example:** Render model view with only layers 5 and 6 displayed
233242```
234243model_view(attention, tokens, include_layers=[5, 6])
235244```
236245
237246For the model view, you may also restrict the visualization to a subset of attention heads (zero-indexed) by setting the
238247` include_heads ` parameter.
239248
240- #### Dark / light mode
241-
242- The model view and neuron view support dark (default) and light modes. You may turn off dark mode in these views using
243- the ` display_mode ` parameter:
244-
245- ```
246- model_view(attention, tokens, display_mode="light")
247- ```
248249
249250#### Setting default layer/head(s)
250251
251252In the head view, you may choose a specific ` layer ` and collection of ` heads ` as the default selection when the
252- visualization first renders. ( Note that this is different from the ` include_heads ` /` include_layers ` parameter (above), which
253- removes layers and heads from the visualization completely.)
253+ visualization first renders. Note: this is different from the ` include_heads ` /` include_layers ` parameter (above), which
254+ removes layers and heads from the visualization completely.
254255
255- ** Example:** Render head view with layer 2 and heads 3 and 5 preselected:
256+ ** Example:** Render head view with layer 2 and heads 3 and 5 pre-selected
256257```
257258head_view(attention, tokens, layer=2, heads=[3,5])
258259```
0 commit comments