本文整理汇总了Python中pycrayon.CrayonClient方法的典型用法代码示例。如果您正苦于以下问题:Python pycrayon.CrayonClient方法的具体用法?Python pycrayon.CrayonClient怎么用?Python pycrayon.CrayonClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycrayon
的用法示例。
在下文中一共展示了pycrayon.CrayonClient方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def main():
""" Opens the crayon client and removes the specified experiment."""
crayon_client = CrayonClient("localhost")
crayon_client.remove_experiment(sys.argv[1])
示例2: main
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def main():
""" Asks users whether they want to delete all experiments and then deletes."""
crayon_client = pycrayon.CrayonClient("localhost")
choice = raw_input("Are you sure? ")
if choice == 'y':
crayon_client.remove_all_experiments()
else:
print("Not deleting")
示例3: __init__
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def __init__(self, name, runs_distributed, runs_cluster, chief_handle, path_log_storage=None,
crayon_server_address="localhost"):
self._name = name
self._path_log_storage = path_log_storage
if path_log_storage is not None:
create_dir_if_not_exist(path_log_storage)
self._chief_handle = chief_handle
self._crayon = CrayonClient(hostname=crayon_server_address)
self._experiments = {}
self.clear()
self._custom_logs = {} # dict of exps containing dict of graph names containing lists of {step: val, } dicts
self._ray = MaybeRay(runs_distributed=runs_distributed, runs_cluster=runs_cluster)
示例4: test_init
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def test_init(self):
CrayonClient(port=self.test_server_port)
示例5: test_init_wrong_localhost
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def test_init_wrong_localhost(self):
self.assertRaises(ValueError, CrayonClient, "not_open",
self.test_server_port)
示例6: test_init_wrong_port
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def test_init_wrong_port(self):
self.assertRaises(ValueError, CrayonClient, "localhost", 123412341234)
示例7: test_init_xp_empty
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def test_init_xp_empty(self):
cc = CrayonClient(port=self.test_server_port)
self.assertRaises(ValueError, cc.create_experiment, "")
示例8: test_open_experiment
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def test_open_experiment(self):
cc = CrayonClient(port=self.test_server_port)
foo = cc.create_experiment("foo")
foo.add_scalar_value("bar", 1, step=2, wall_time=0)
foo = cc.open_experiment("foo")
foo.add_scalar_value("bar", 3, wall_time=1)
self.assertEqual(foo.get_scalar_values("bar"),
[[0.0, 2, 1.0], [1.0, 3, 3.0]])
示例9: test_add_scalar_value
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def test_add_scalar_value(self):
cc = CrayonClient(port=self.test_server_port)
foo = cc.create_experiment("foo")
foo.add_scalar_value("bar", 2, wall_time=time.clock(), step=1)
示例10: test_add_scalar_less_data
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def test_add_scalar_less_data(self):
cc = CrayonClient(port=self.test_server_port)
foo = cc.create_experiment("foo")
foo.add_scalar_value("bar", 2)
# TODO These should really be tested singularly...
示例11: test_add_scalar_wrong_data
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def test_add_scalar_wrong_data(self):
cc = CrayonClient(port=self.test_server_port)
foo = cc.create_experiment("foo")
self.assertRaises(ValueError, foo.add_scalar_value,
"bar", "lol")
示例12: test_add_scalar_wrong_variable
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def test_add_scalar_wrong_variable(self):
cc = CrayonClient(port=self.test_server_port)
foo = cc.create_experiment("foo")
self.assertRaises(ValueError, foo.add_scalar_value,
"", 2)
示例13: test_add_scalar_dict
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def test_add_scalar_dict(self):
cc = CrayonClient(port=self.test_server_port)
foo = cc.create_experiment("foo")
data = {"fizz": 3, "buzz": 5}
foo.add_scalar_dict(data, wall_time=0, step=5)
data = {"fizz": 6, "buzz": 10}
foo.add_scalar_dict(data)
示例14: test_get_scalar_values_no_data
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def test_get_scalar_values_no_data(self):
cc = CrayonClient(port=self.test_server_port)
foo = cc.create_experiment("foo")
self.assertRaises(ValueError, foo.get_scalar_values, "bar")
示例15: test_get_scalar_values_one_datum
# 需要导入模块: import pycrayon [as 别名]
# 或者: from pycrayon import CrayonClient [as 别名]
def test_get_scalar_values_one_datum(self):
cc = CrayonClient(port=self.test_server_port)
foo = cc.create_experiment("foo")
foo.add_scalar_value("bar", 0, wall_time=0, step=0)
self.assertEqual(foo.get_scalar_values("bar"), [[0.0, 0, 0.0]])