You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# For Production - real CA-signed certificate (default)
247
+
vis = visdom.Visdom(server="https://myserver.com")
248
+
249
+
# For Development - self signed certificate
250
+
vis = visdom.Visdom(server="https://localhost", ssl_verify=False)
251
+
```
252
+
253
+
> **Note**: `ssl_verify=False` disables certificate verification and should only be used in development with self-signed certificates. Do not use in production.
254
+
255
+
230
256
#### Python example
231
257
```python
232
258
import visdom
@@ -268,6 +294,7 @@ Other options are either currently unused (endpoint, ipv6) or used for internal
268
294
Visdom offers the following basic visualization functions:
269
295
-[`vis.image`](#visimage) : image
270
296
-[`vis.image_heatmap`](#visimageheatmap) : image with heatmap overlay
297
+
-[`vis.update_image_slider`](#visupdate_image_slider) : set visible frame of an image_history pane
-[`vis.replay_log`](#visreplay_log): replay the actions from the provided log file
333
360
334
361
362
+
## Loggers
363
+
364
+
Framework-specific logging bridges that wrap the Visdom API so training loops stay focused on training. Each logger lives in its own submodule and handles window creation, step tracking, and throttling internally.
365
+
366
+
### PyTorch
367
+
368
+
`visdom.pytorch.VisdomLogger` is a context manager for raw PyTorch training loops. Call `tracker.log(name, value)` for any scalar — no `viz.line()` arguments needed.
369
+
370
+
**Epoch-level logging** (recommended default — one call per epoch):
-`env`: environment name (default: auto-generated from timestamp)
407
+
-`log_every`: send every N calls per metric — use with per-batch logging on large datasets (default: `1`)
408
+
409
+
Each unique name passed to `tracker.log()` gets its own window. The first call creates it; subsequent calls append. See `example/train_example.py` for a full working example.
410
+
411
+
### scikit-learn
412
+
413
+
`visdom.loggers.VisdomSklearnLogger` patches all sklearn `fit()` calls so every estimator trained after `autolog()` logs to Visdom automatically — no per-estimator code needed.
414
+
415
+
**Plain estimators** (classifiers, regressors, clusterers) produce a text pane with the estimator name, dataset shape, training score, fit time, and all hyperparameters.
416
+
417
+
**GridSearchCV / RandomizedSearchCV** produce a bar chart of `mean_test_score` per parameter combination and a text pane with `best_score_`, `best_params_`, and fit time.
418
+
419
+
```python
420
+
import visdom
421
+
from visdom.loggers import VisdomSklearnLogger
422
+
from sklearn.ensemble import RandomForestClassifier
423
+
from sklearn.linear_model import Ridge
424
+
from sklearn.model_selection import GridSearchCV
425
+
426
+
viz = visdom.Visdom()
427
+
VisdomSklearnLogger.autolog()
428
+
429
+
clf = RandomForestClassifier(n_estimators=100)
430
+
clf.fit(X_train, y_train) # -> text pane
431
+
432
+
reg = Ridge(alpha=1.0)
433
+
reg.fit(X_train, y_train) # -> text pane
434
+
435
+
gs = GridSearchCV(clf, param_grid, cv=3)
436
+
gs.fit(X_train, y_train) # -> bar chart + text pane
437
+
```
438
+
439
+
If you have a custom Visdom connection (non-default port, remote server, auth), pass it explicitly:
440
+
441
+
```python
442
+
import visdom
443
+
444
+
viz = visdom.Visdom(port=8098, server="http://myserver")
@@ -356,6 +475,18 @@ The following `opts` are supported:
356
475
-`caption`: Caption for the image
357
476
-`store_history`: Keep all images stored to the same window and attach a slider to the bottom that will let you select the image to view. You must always provide this opt when sending new images to an image with history.
358
477
478
+
#### vis.update_image_slider
479
+
480
+
Programmatically set the visible frame of an `image_history` pane from Python:
vis.update_image_slider(win, index=1) # show second frame
486
+
```
487
+
488
+
The `index` is 0-based and is clamped to the valid range by the server. NumPy integer scalars (e.g. `np.int64`) are accepted and coerced automatically. Passing a non-integer or a non-`image_history` window raises an error.
489
+
359
490
> **Note** You can use alt on an image pane to view the x/y coordinates of the cursor. You can also ctrl-scroll to zoom, alt scroll to pan vertically, and alt-shift scroll to pan horizontally. Double click inside the pane to restore the image to default.
360
491
361
492
@@ -499,6 +630,7 @@ The function accepts the following arguments:
499
630
-`labels`: a list of corresponding labels for the tensors provided for `features`
500
631
-`data_getter=fn`: (optional) a function that takes as a parameter an index into the features array and returns a summary representation of the tensor. If this is set, `data_type` must also be set.
501
632
-`data_type=str`: (optional) currently the only acceptable value here is `"html"`
633
+
-`opts.register_embedding_events`: (optional) set to `False` to skip registering the default Python client event handler for hover previews and lasso drilldown. This leaves embeddings interaction events for external server or frontend code to handle.
502
634
503
635
We currently assume that there are no more than 10 unique labels, in the future we hope to provide a colormap in opts for other cases.
504
636
@@ -909,6 +1041,7 @@ The following `opts` are generic in the sense that they are the same for all vis
909
1041
-`opts.marginright` : right margin (in pixels)
910
1042
-`opts.margintop` : top margin (in pixels)
911
1043
-`opts.marginbottom`: bottom margin (in pixels)
1044
+
-`opts.caption` : caption displayed below the plot (`string`; optional)
912
1045
913
1046
`opts` are passed as dictionary in python scripts.You can pass `opts` like:
|`state_manager.py`|`StateManager` class wrapping the top-level `state` dict. Methods: `get_env()`, `create_env()`, `delete_env()`, `list_envs()`, `fork_env()`, `serialize()`, `serialize_all()`. Absorbs functions from `server_utils.py` (`serialize_env`, `serialize_all`, `load_env`, `gather_envs`, `compare_envs`)|
82
+
|`state_manager.py`|`StateManager` class wrapping the top-level `state` dict. Methods: `get_env()`, `create_env()`, `delete_env()`, `list_envs()`, `fork_env()`, `serialize()`, `serialize_all()`. Absorbs functions from `server_utils.py` (`load_env`, `gather_envs`, `compare_envs`). Environment file serialization now lives in `data_model/json_store.py` (`JSONStore`) via the `DataStore` abstraction|
83
83
|`window.py`| Typed window structures (dataclasses/TypedDicts) replacing raw dicts built in `server_utils.py:window()` (lines 202-258) |
0 commit comments