Here we will setup the server and store the model representation on the fastai `Learn` object..
path = untar_data(URLs.MNIST_TINY)
dls = ImageDataLoaders.from_folder(path)
learn = cnn_learner(dls, resnet18, pretrained=False)

Event types

class Events[source]

Events(d)

Available events

clientEvents define the actions managed by the web client (send from python, executed by js):

clientEvents
Events (
  SEND_DATA: socket/socketReceiveData
  INVALID_EVENT: socket/socketInvalidEvent
  SEND_IMAGE_INPUT: socket/socketReceiveImageInput
  NOIMAGE_HEATMAP: socket/socketNoImageHeatmap
  SEND_HEATMAP: socket/socketReceiveHeatmap
  SEND_ERROR: socket/socketError
  CLOSE_CLIENT: socket/socketServerClosed
)

serverEvents define the actions managed by the FastExplorer server (send by js, executed by python).

serverEvents
Events (
  RECEIVE_EVENT: socket/sendEvent
)

Server

class FastExplorer[source]

FastExplorer(learn, host='0.0.0.0', port=8000)

Wrapper around Representation and ProxyServer.

Learner.fastexplorer[source]

Learner.fastexplorer(reload=False, host='0.0.0.0', port=8000)

Utils

header_data_from_array_1_0[source]

header_data_from_array_1_0(array)

get_numpy_bytes[source]

get_numpy_bytes(x, typ, xtra=None)

Transforms a numpy array into bytes and attach a clientEvents

xb,yb = dls.one_batch()
xx = xb.cpu().numpy()[0,0]
xx.shape
(28, 28)
_get_module_path(learn.model, '0/4/0/relu')
ReLU(inplace=True)

Events handlers

Functions defined here are sended by the web client in upper case (eg:LOAD_INPUT)

load_input[source]

load_input(websocket, payload=None)

Sends a data sample to the client.

FastExplorer.load_input[source]

FastExplorer.load_input(websocket, payload=None)

Sends a data sample to the client.

get_heatmap[source]

get_heatmap(websocket, payload)

Sends the heatmap for a particular layer.

FastExplorer.get_heatmap[source]

FastExplorer.get_heatmap(websocket, payload)

Sends the heatmap for a particular layer.

learn.fastexplorer(True)
INFO:root:To visualize the model information, go to:
INFO:root:https://renato145.github.io/fastexplorer-js
INFO:     Started server process [1652]
INFO:uvicorn.error:Started server process [1652]
INFO:     Waiting for application startup.
INFO:uvicorn.error:Waiting for application startup.
INFO:     Application startup complete.
INFO:uvicorn.error:Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:uvicorn.error:Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     Shutting down
INFO:uvicorn.error:Shutting down
INFO:     Waiting for application shutdown.
INFO:uvicorn.error:Waiting for application shutdown.
INFO:     Application shutdown complete.
INFO:uvicorn.error:Application shutdown complete.
INFO:     Finished server process [1652]
INFO:uvicorn.error:Finished server process [1652]