本文整理匯總了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]])