10 #include <autogradpp/autograd.h> 11 #include <mapbox/variant.hpp> 14 #include <unordered_map> 30 : server(
std::move(server)), port(port), ipv6(ipv6), proxy(proxy) {}
41 using Options = std::unordered_map<std::string, OptionValue>;
45 : first(
std::move(key)), second(
std::move(value)) {}
47 : first(
std::move(key)), second(
std::string(value)) {}
49 : first(
std::move(key)), second(value) {}
51 : first(
std::move(key)), second(value) {}
53 : first(
std::move(key)), second(double(value)) {}
55 : first(
std::move(key)), second(double(value)) {}
56 OptionPair(std::string key, std::initializer_list<std::string> value)
57 : first(
std::move(key)), second(
std::vector<
std::string>(value)) {}
65 for (
auto const& it : init) {
66 opts[it.first] = it.second;
84 std::string env =
"main",
93 std::string save(std::vector<std::string>
const& envs);
100 std::string
const& win = std::string(),
101 std::string
const& env = std::string());
109 return text(txt, {}, {}, opts);
112 std::string
const& txt,
113 std::string
const& win,
115 return text(txt, win, {}, opts);
118 std::string
const& txt,
119 std::string
const& win,
120 std::string
const& env,
136 return heatmap(tensor, {}, {}, opts);
139 torch::Tensor tensor,
140 std::string
const& win,
142 return heatmap(tensor, win, {}, opts);
145 torch::Tensor tensor,
146 std::string
const& win,
147 std::string
const& env,
173 return scatter(X, torch::Tensor(), {}, {}, {}, opts, update);
177 std::string
const& win,
180 return scatter(X, torch::Tensor(), win, {}, {}, opts, update);
184 std::string
const& win,
185 std::string
const& env,
188 return scatter(X, torch::Tensor(), win, env, {}, opts, update);
192 std::string
const& win,
193 std::string
const& env,
194 std::string
const& name,
197 return scatter(X, torch::Tensor(), win, env, name, opts, update);
204 return scatter(X, Y, {}, {}, {}, opts, update);
209 std::string
const& win,
212 return scatter(X, Y, win, {}, {}, opts, update);
217 std::string
const& win,
218 std::string
const& env,
221 return scatter(X, Y, win, env, {}, opts, update);
226 std::string
const& win,
227 std::string
const& env,
228 std::string
const& name,
259 return line(Y, torch::Tensor(), {}, {}, {}, opts, update);
263 std::string
const& win,
266 return line(Y, torch::Tensor(), win, {}, {}, opts, update);
270 std::string
const& win,
271 std::string
const& env,
274 return line(Y, torch::Tensor(), win, env, {}, opts, update);
278 std::string
const& win,
279 std::string
const& env,
280 std::string
const& name,
283 return line(Y, torch::Tensor(), win, env, name, opts, update);
290 return line(Y, X, {}, {}, {}, opts, update);
295 std::string
const& win,
298 return line(Y, X, win, {}, {}, opts, update);
303 std::string
const& win,
304 std::string
const& env,
307 return line(Y, X, win, env, {}, opts, update);
312 std::string
const& win,
313 std::string
const& env,
314 std::string
const& name,
std::string scatter(torch::Tensor X, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
This function draws a 2D or 3D scatter plot.
Definition: visdom.h:169
std::string line(torch::Tensor Y, std::string const &win, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
Definition: visdom.h:261
Definition: checkpointer.h:12
std::string line(torch::Tensor Y, std::string const &win, std::string const &env, std::string const &name, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
Definition: visdom.h:276
std::string heatmap(torch::Tensor tensor, std::string const &win, Options const &opts=Options())
Definition: visdom.h:138
std::string line(torch::Tensor Y, torch::Tensor X, std::string const &win, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
Definition: visdom.h:292
std::string line(torch::Tensor Y, std::string const &win, std::string const &env, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
Definition: visdom.h:268
std::string heatmap(torch::Tensor tensor, Options const &opts=Options())
This function draws a heatmap.
Definition: visdom.h:135
Definition: visdom.cpp:400
std::string scatter(torch::Tensor X, torch::Tensor Y, std::string const &win, std::string const &env, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
Definition: visdom.h:214
std::string scatter(torch::Tensor X, torch::Tensor Y, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
Definition: visdom.h:199
UpdateMethod
Definition: visdom.h:71
OptionPair(std::string key, double value)
Definition: visdom.h:50
std::string scatter(torch::Tensor X, torch::Tensor Y, std::string const &win, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
Definition: visdom.h:206
mapbox::util::variant< bool, double, std::string, StringList, StringListMap, torch::Tensor > OptionValue
Definition: visdom.h:40
std::string first
Definition: visdom.h:59
int port
Definition: visdom.h:20
OptionPair(std::string key, OptionValue &&value)
Definition: visdom.h:44
ConnectionParams()
Definition: visdom.h:24
ConnectionParams(std::string server, int port=8097, bool ipv6=true, bool proxy=false)
Definition: visdom.h:25
std::string server
Definition: visdom.h:19
std::string line(torch::Tensor Y, torch::Tensor X, std::string const &win, std::string const &env, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
Definition: visdom.h:300
std::string scatter(torch::Tensor X, std::string const &win, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
Definition: visdom.h:175
OptionPair(std::string key, float value)
Definition: visdom.h:52
std::string line(torch::Tensor Y, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
This function draws a line plot.
Definition: visdom.h:255
OptionPair(std::string key, std::initializer_list< std::string > value)
Definition: visdom.h:56
OptionValue second
Definition: visdom.h:60
std::string text(std::string const &txt, std::string const &win, Options const &opts=Options())
Definition: visdom.h:111
std::vector< std::string > StringList
Definition: visdom.h:33
std::string line(torch::Tensor Y, torch::Tensor X, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
Definition: visdom.h:285
std::unordered_map< int, StringList > StringListMap
Definition: visdom.h:34
OptionPair(std::string key, char const *value)
Definition: visdom.h:46
std::unordered_map< std::string, OptionValue > Options
Definition: visdom.h:41
std::string scatter(torch::Tensor X, std::string const &win, std::string const &env, std::string const &name, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
Definition: visdom.h:190
bool ipv6
Definition: visdom.h:21
bool proxy
Definition: visdom.h:22
OptionPair(std::string key, int value)
Definition: visdom.h:54
std::string scatter(torch::Tensor X, std::string const &win, std::string const &env, Options const &opts=Options(), UpdateMethod update=UpdateMethod::None)
Definition: visdom.h:182
std::string text(std::string const &txt, Options const &opts=Options())
This funciton prints text in a box.
Definition: visdom.h:108
Options makeOpts(std::initializer_list< OptionPair > init)
Definition: visdom.h:63
OptionPair(std::string key, bool value)
Definition: visdom.h:48