id int64 1 6.07M | name stringlengths 1 295 | code stringlengths 12 426k | language stringclasses 1
value | source_file stringlengths 5 202 | start_line int64 1 158k | end_line int64 1 158k | repo dict |
|---|---|---|---|---|---|---|---|
1,101 | __init__ | def __init__(
self,
id=None,
name=None,
class_name=None,
size=None,
parameters=None,
output_shape=None,
is_output=None,
num_parameters=None,
node=None,
):
self._attributes = {"name": None}
self.in_edges = {} # indexed b... | python | wandb/data_types.py | 1,553 | 1,591 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,102 | to_json | def to_json(self, run=None):
return self._attributes | python | wandb/data_types.py | 1,593 | 1,594 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,103 | __repr__ | def __repr__(self):
return repr(self._attributes) | python | wandb/data_types.py | 1,596 | 1,597 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,104 | id | def id(self):
"""Must be unique in the graph."""
return self._attributes.get("id") | python | wandb/data_types.py | 1,600 | 1,602 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,105 | id | def id(self, val):
self._attributes["id"] = val
return val | python | wandb/data_types.py | 1,605 | 1,607 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,106 | name | def name(self):
"""Usually the type of layer or sublayer."""
return self._attributes.get("name") | python | wandb/data_types.py | 1,610 | 1,612 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,107 | name | def name(self, val):
self._attributes["name"] = val
return val | python | wandb/data_types.py | 1,615 | 1,617 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,108 | class_name | def class_name(self):
"""Usually the type of layer or sublayer."""
return self._attributes.get("class_name") | python | wandb/data_types.py | 1,620 | 1,622 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,109 | class_name | def class_name(self, val):
self._attributes["class_name"] = val
return val | python | wandb/data_types.py | 1,625 | 1,627 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,110 | functions | def functions(self):
return self._attributes.get("functions", []) | python | wandb/data_types.py | 1,630 | 1,631 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,111 | functions | def functions(self, val):
self._attributes["functions"] = val
return val | python | wandb/data_types.py | 1,634 | 1,636 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,112 | parameters | def parameters(self):
return self._attributes.get("parameters", []) | python | wandb/data_types.py | 1,639 | 1,640 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,113 | parameters | def parameters(self, val):
self._attributes["parameters"] = val
return val | python | wandb/data_types.py | 1,643 | 1,645 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,114 | size | def size(self):
return self._attributes.get("size") | python | wandb/data_types.py | 1,648 | 1,649 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,115 | size | def size(self, val):
"""Tensor size."""
self._attributes["size"] = tuple(val)
return val | python | wandb/data_types.py | 1,652 | 1,655 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,116 | output_shape | def output_shape(self):
return self._attributes.get("output_shape") | python | wandb/data_types.py | 1,658 | 1,659 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,117 | output_shape | def output_shape(self, val):
"""Tensor output_shape."""
self._attributes["output_shape"] = val
return val | python | wandb/data_types.py | 1,662 | 1,665 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,118 | is_output | def is_output(self):
return self._attributes.get("is_output") | python | wandb/data_types.py | 1,668 | 1,669 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,119 | is_output | def is_output(self, val):
"""Tensor is_output."""
self._attributes["is_output"] = val
return val | python | wandb/data_types.py | 1,672 | 1,675 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,120 | num_parameters | def num_parameters(self):
return self._attributes.get("num_parameters") | python | wandb/data_types.py | 1,678 | 1,679 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,121 | num_parameters | def num_parameters(self, val):
"""Tensor num_parameters."""
self._attributes["num_parameters"] = val
return val | python | wandb/data_types.py | 1,682 | 1,685 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,122 | child_parameters | def child_parameters(self):
return self._attributes.get("child_parameters") | python | wandb/data_types.py | 1,688 | 1,689 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,123 | child_parameters | def child_parameters(self, val):
"""Tensor child_parameters."""
self._attributes["child_parameters"] = val
return val | python | wandb/data_types.py | 1,692 | 1,695 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,124 | is_constant | def is_constant(self):
return self._attributes.get("is_constant") | python | wandb/data_types.py | 1,698 | 1,699 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,125 | is_constant | def is_constant(self, val):
"""Tensor is_constant."""
self._attributes["is_constant"] = val
return val | python | wandb/data_types.py | 1,702 | 1,705 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,126 | from_keras | def from_keras(cls, layer):
node = cls()
try:
output_shape = layer.output_shape
except AttributeError:
output_shape = ["multiple"]
node.id = layer.name
node.name = layer.name
node.class_name = layer.__class__.__name__
node.output_shape = ... | python | wandb/data_types.py | 1,708 | 1,722 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,127 | __init__ | def __init__(self, from_node, to_node):
self._attributes = {}
self.from_node = from_node
self.to_node = to_node | python | wandb/data_types.py | 1,728 | 1,731 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,128 | __repr__ | def __repr__(self):
temp_attr = dict(self._attributes)
del temp_attr["from_node"]
del temp_attr["to_node"]
temp_attr["from_id"] = self.from_node.id
temp_attr["to_id"] = self.to_node.id
return str(temp_attr) | python | wandb/data_types.py | 1,733 | 1,739 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,129 | to_json | def to_json(self, run=None):
return [self.from_node.id, self.to_node.id] | python | wandb/data_types.py | 1,741 | 1,742 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,130 | name | def name(self):
"""Optional, not necessarily unique."""
return self._attributes.get("name") | python | wandb/data_types.py | 1,745 | 1,747 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,131 | name | def name(self, val):
self._attributes["name"] = val
return val | python | wandb/data_types.py | 1,750 | 1,752 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,132 | from_node | def from_node(self):
return self._attributes.get("from_node") | python | wandb/data_types.py | 1,755 | 1,756 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,133 | from_node | def from_node(self, val):
self._attributes["from_node"] = val
return val | python | wandb/data_types.py | 1,759 | 1,761 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,134 | to_node | def to_node(self):
return self._attributes.get("to_node") | python | wandb/data_types.py | 1,764 | 1,765 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,135 | to_node | def to_node(self, val):
self._attributes["to_node"] = val
return val | python | wandb/data_types.py | 1,768 | 1,770 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,136 | __init__ | def __init__(
self,
box_layers=None,
box_score_keys=None,
mask_layers=None,
class_map=None,
**kwargs,
):
box_layers = box_layers or {}
box_score_keys = box_score_keys or []
mask_layers = mask_layers or {}
class_map = class_map or {}
... | python | wandb/data_types.py | 1,779 | 1,831 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,137 | assign_type | def assign_type(self, wb_type=None):
if isinstance(wb_type, _ImageFileType):
box_layers_self = self.params["box_layers"].params["val"] or {}
box_score_keys_self = self.params["box_score_keys"].params["val"] or []
mask_layers_self = self.params["mask_layers"].params["val"] or ... | python | wandb/data_types.py | 1,833 | 1,880 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,138 | from_obj | def from_obj(cls, py_obj):
if not isinstance(py_obj, Image):
raise TypeError("py_obj must be a wandb.Image")
else:
if hasattr(py_obj, "_boxes") and py_obj._boxes:
box_layers = {
str(key): set(py_obj._boxes[key]._class_labels.keys())
... | python | wandb/data_types.py | 1,883 | 1,922 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,139 | __init__ | def __init__(self, column_types=None):
if column_types is None:
column_types = _dtypes.UnknownType()
if isinstance(column_types, dict):
column_types = _dtypes.TypedDictType(column_types)
elif not (
isinstance(column_types, _dtypes.TypedDictType)
or... | python | wandb/data_types.py | 1,930 | 1,941 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,140 | assign_type | def assign_type(self, wb_type=None):
if isinstance(wb_type, _TableType):
column_types = self.params["column_types"].assign_type(
wb_type.params["column_types"]
)
if not isinstance(column_types, _dtypes.InvalidType):
return _TableType(column_typ... | python | wandb/data_types.py | 1,943 | 1,951 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,141 | from_obj | def from_obj(cls, py_obj):
if not isinstance(py_obj, Table):
raise TypeError("py_obj must be a wandb.Table")
else:
return cls(py_obj._column_types) | python | wandb/data_types.py | 1,954 | 1,958 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,142 | __init__ | def __init__(self, table, col_name):
assert isinstance(table, Table)
assert isinstance(col_name, str)
assert col_name in table.columns
self.params.update({"table": table, "col_name": col_name}) | python | wandb/data_types.py | 1,966 | 1,970 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,143 | assign_type | def assign_type(self, wb_type=None):
if isinstance(wb_type, _dtypes.StringType):
return self
elif (
isinstance(wb_type, _ForeignKeyType)
and id(self.params["table"]) == id(wb_type.params["table"])
and self.params["col_name"] == wb_type.params["col_name"]
... | python | wandb/data_types.py | 1,972 | 1,982 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,144 | from_obj | def from_obj(cls, py_obj):
if not isinstance(py_obj, _TableKey):
raise TypeError("py_obj must be a _TableKey")
else:
return cls(py_obj._table, py_obj._col_name) | python | wandb/data_types.py | 1,985 | 1,989 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,145 | to_json | def to_json(self, artifact=None):
res = super().to_json(artifact)
if artifact is not None:
table_name = f"media/tables/t_{runid.generate_id()}"
entry = artifact.add(self.params["table"], table_name)
res["params"]["table"] = entry.path
else:
raise A... | python | wandb/data_types.py | 1,991 | 2,001 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,146 | from_json | def from_json(
cls,
json_dict,
artifact,
):
table = None
col_name = None
if artifact is None:
raise AssertionError(
"_ForeignKeyType does not support deserialization without an artifact"
)
else:
table = artif... | python | wandb/data_types.py | 2,004 | 2,022 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,147 | __init__ | def __init__(self, table):
assert isinstance(table, Table)
self.params.update({"table": table}) | python | wandb/data_types.py | 2,030 | 2,032 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,148 | assign_type | def assign_type(self, wb_type=None):
if isinstance(wb_type, _dtypes.NumberType):
return self
elif isinstance(wb_type, _ForeignIndexType) and id(self.params["table"]) == id(
wb_type.params["table"]
):
return self
return _dtypes.InvalidType() | python | wandb/data_types.py | 2,034 | 2,042 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,149 | from_obj | def from_obj(cls, py_obj):
if not isinstance(py_obj, _TableIndex):
raise TypeError("py_obj must be a _TableIndex")
else:
return cls(py_obj._table) | python | wandb/data_types.py | 2,045 | 2,049 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,150 | to_json | def to_json(self, artifact=None):
res = super().to_json(artifact)
if artifact is not None:
table_name = f"media/tables/t_{runid.generate_id()}"
entry = artifact.add(self.params["table"], table_name)
res["params"]["table"] = entry.path
else:
raise A... | python | wandb/data_types.py | 2,051 | 2,061 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,151 | from_json | def from_json(
cls,
json_dict,
artifact,
):
table = None
if artifact is None:
raise AssertionError(
"_ForeignIndexType does not support deserialization without an artifact"
)
else:
table = artifact.get(json_dict["par... | python | wandb/data_types.py | 2,064 | 2,080 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,152 | assign_type | def assign_type(self, wb_type=None):
if isinstance(wb_type, _dtypes.StringType) or isinstance(
wb_type, _PrimaryKeyType
):
return self
return _dtypes.InvalidType() | python | wandb/data_types.py | 2,087 | 2,092 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,153 | from_obj | def from_obj(cls, py_obj):
if not isinstance(py_obj, _TableKey):
raise TypeError("py_obj must be a wandb.Table")
else:
return cls() | python | wandb/data_types.py | 2,095 | 2,099 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,154 | _id_generator | def _id_generator(size=10, chars=string.ascii_lowercase + string.digits):
return "".join(random.choice(chars) for _ in range(size)) | python | wandb/wandb_controller.py | 85 | 86 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,155 | __init__ | def __init__(self, sweep_id_or_config=None, entity=None, project=None):
# sweep id configured in constuctor
self._sweep_id: Optional[str] = None
# configured parameters
# Configuration to be created
self._create: Dict = {}
# Custom search
self._custom_search: Opt... | python | wandb/wandb_controller.py | 130 | 220 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,156 | configure_search | def configure_search(
self,
search: Union[
str,
Callable[
[Union[dict, sweeps.SweepConfig], List[sweeps.SweepRun]],
Optional[sweeps.SweepRun],
],
],
):
self._configure_check()
if isinstance(search, str):
... | python | wandb/wandb_controller.py | 222 | 239 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,157 | configure_stopping | def configure_stopping(
self,
stopping: Union[
str,
Callable[
[Union[dict, sweeps.SweepConfig], List[sweeps.SweepRun]],
List[sweeps.SweepRun],
],
],
**kwargs,
):
self._configure_check()
if isinstance(... | python | wandb/wandb_controller.py | 241 | 263 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,158 | configure_metric | def configure_metric(self, metric, goal=None):
self._configure_check()
self._create.setdefault("metric", {})
self._create["metric"]["name"] = metric
if goal:
self._create["metric"]["goal"] = goal | python | wandb/wandb_controller.py | 265 | 270 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,159 | configure_program | def configure_program(self, program):
self._configure_check()
if isinstance(program, str):
self._create["program"] = program
elif callable(program):
self._create["program"] = "__callable__"
self._program_function = program
raise ControllerError("Pr... | python | wandb/wandb_controller.py | 272 | 281 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,160 | configure_name | def configure_name(self, name):
self._configure_check()
self._create["name"] = name | python | wandb/wandb_controller.py | 283 | 285 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,161 | configure_description | def configure_description(self, description):
self._configure_check()
self._create["description"] = description | python | wandb/wandb_controller.py | 287 | 289 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,162 | configure_parameter | def configure_parameter(
self,
name,
values=None,
value=None,
distribution=None,
min=None,
max=None,
mu=None,
sigma=None,
q=None,
a=None,
b=None,
):
self._configure_check()
self._create.setdefault("parame... | python | wandb/wandb_controller.py | 291 | 326 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,163 | configure_controller | def configure_controller(self, type):
"""Configure controller to local if type == 'local'."""
self._configure_check()
self._create.setdefault("controller", {})
self._create["controller"].setdefault("type", type) | python | wandb/wandb_controller.py | 328 | 332 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,164 | configure | def configure(self, sweep_dict_or_config):
self._configure_check()
if self._create:
raise ControllerError("Already configured.")
if isinstance(sweep_dict_or_config, dict):
self._create = sweep_dict_or_config
elif isinstance(sweep_dict_or_config, str):
... | python | wandb/wandb_controller.py | 334 | 343 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,165 | sweep_config | def sweep_config(self) -> Union[dict, sweeps.SweepConfig]:
return self._sweep_config | python | wandb/wandb_controller.py | 346 | 347 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,166 | sweep_id | def sweep_id(self) -> str:
return self._sweep_id | python | wandb/wandb_controller.py | 350 | 351 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,167 | _log | def _log(self) -> None:
self._logged += 1 | python | wandb/wandb_controller.py | 353 | 354 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,168 | _error | def _error(self, s: str) -> None:
print("ERROR:", s)
self._log() | python | wandb/wandb_controller.py | 356 | 358 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,169 | _warn | def _warn(self, s: str) -> None:
print("WARN:", s)
self._log() | python | wandb/wandb_controller.py | 360 | 362 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,170 | _info | def _info(self, s: str) -> None:
print("INFO:", s)
self._log() | python | wandb/wandb_controller.py | 364 | 366 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,171 | _debug | def _debug(self, s: str) -> None:
print("DEBUG:", s)
self._log() | python | wandb/wandb_controller.py | 368 | 370 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,172 | _configure_check | def _configure_check(self) -> None:
if self._started:
raise ControllerError("Can not configure after sweep has been started.") | python | wandb/wandb_controller.py | 372 | 374 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,173 | _validate | def _validate(self, config: Dict) -> str:
violations = sweeps.schema_violations_from_proposed_config(config)
msg = (
sweep_config_err_text_from_jsonschema_violations(violations)
if len(violations) > 0
else ""
)
return msg | python | wandb/wandb_controller.py | 376 | 383 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,174 | create | def create(self, from_dict: bool = False) -> str:
if self._started:
raise ControllerError("Can not create after sweep has been started.")
if not self._defer_sweep_creation and not from_dict:
raise ControllerError("Can not use create on already created sweep.")
if not self... | python | wandb/wandb_controller.py | 385 | 406 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,175 | run | def run(
self,
verbose: bool = False,
print_status: bool = True,
print_actions: bool = False,
print_debug: bool = False,
) -> None:
if verbose:
print_status = True
print_actions = True
print_debug = True
self._start_if_not_s... | python | wandb/wandb_controller.py | 408 | 428 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,176 | _sweep_object_read_from_backend | def _sweep_object_read_from_backend(self) -> Optional[dict]:
specs_json = {}
if self._sweep_metric:
k = ["_step"]
k.append(self._sweep_metric)
specs_json = {"keys": k, "samples": 100000}
specs = json.dumps(specs_json)
# TODO(jhr): catch exceptions?
... | python | wandb/wandb_controller.py | 430 | 475 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,177 | _sweep_object_sync_to_backend | def _sweep_object_sync_to_backend(self) -> None:
if self._controller == self._controller_prev_step:
return
sweep_obj_id = self._sweep_obj["id"]
controller = json.dumps(self._controller)
_, warnings = self._api.upsert_sweep(
self._sweep_config, controller=controlle... | python | wandb/wandb_controller.py | 477 | 486 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,178 | _start_if_not_started | def _start_if_not_started(self) -> None:
if self._started:
return
if self._defer_sweep_creation:
raise ControllerError(
"Must specify or create a sweep before running controller."
)
obj = self._sweep_object_read_from_backend()
if not ob... | python | wandb/wandb_controller.py | 488 | 508 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,179 | _parse_scheduled | def _parse_scheduled(self):
scheduled_list = self._scheduler.get("scheduled") or []
started_ids = []
stopped_runs = []
done_runs = []
for s in scheduled_list:
runid = s.get("runid")
objid = s.get("id")
r = self._sweep_runs_map.get(runid)
... | python | wandb/wandb_controller.py | 510 | 529 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,180 | _step | def _step(self) -> None:
self._start_if_not_started()
self._sweep_object_read_from_backend()
started_ids, stopped_runs, done_runs = self._parse_scheduled()
# Remove schedule entry from controller dict if already scheduled
schedule_list = self._controller.get("schedule", [])
... | python | wandb/wandb_controller.py | 531 | 551 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,181 | step | def step(self) -> None:
self._step()
suggestion = self.search()
self.schedule(suggestion)
to_stop = self.stopping()
if len(to_stop) > 0:
self.stop_runs(to_stop) | python | wandb/wandb_controller.py | 553 | 559 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,182 | done | def done(self) -> bool:
self._start_if_not_started()
state = self._sweep_obj.get("state")
if state in [
s.upper()
for s in (
sweeps.RunState.preempting.value,
SWEEP_INITIAL_RUN_STATE.value,
sweeps.RunState.running.value,
... | python | wandb/wandb_controller.py | 561 | 573 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,183 | _search | def _search(self) -> Optional[sweeps.SweepRun]:
search = self._custom_search or sweeps.next_run
next_run = search(self._sweep_config, self._sweep_runs or [])
if next_run is None:
self._done_scheduling = True
return next_run | python | wandb/wandb_controller.py | 575 | 580 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,184 | search | def search(self) -> Optional[sweeps.SweepRun]:
self._start_if_not_started()
suggestion = self._search()
return suggestion | python | wandb/wandb_controller.py | 582 | 585 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,185 | _stopping | def _stopping(self) -> List[sweeps.SweepRun]:
if "early_terminate" not in self.sweep_config:
return []
stopper = self._custom_stopping or sweeps.stop_runs
stop_runs = stopper(self._sweep_config, self._sweep_runs or [])
debug_lines = "\n".join(
[
"... | python | wandb/wandb_controller.py | 587 | 603 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,186 | stopping | def stopping(self) -> List[sweeps.SweepRun]:
self._start_if_not_started()
return self._stopping() | python | wandb/wandb_controller.py | 605 | 607 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,187 | schedule | def schedule(self, run: Optional[sweeps.SweepRun]) -> None:
self._start_if_not_started()
# only schedule one run at a time (for now)
if self._controller and self._controller.get("schedule"):
return
schedule_id = _id_generator()
if run is None:
schedule_... | python | wandb/wandb_controller.py | 609 | 630 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,188 | stop_runs | def stop_runs(self, runs: List[sweeps.SweepRun]) -> None:
earlystop_list = list({run.name for run in runs})
self._log_actions.append(("stop", ",".join(earlystop_list)))
self._controller["earlystop"] = earlystop_list
self._sweep_object_sync_to_backend() | python | wandb/wandb_controller.py | 632 | 636 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,189 | print_status | def print_status(self) -> None:
status = _sweep_status(self._sweep_obj, self._sweep_config, self._sweep_runs)
if self._laststatus != status or self._logged:
print(status)
self._laststatus = status
self._logged = 0 | python | wandb/wandb_controller.py | 638 | 643 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,190 | print_actions | def print_actions(self) -> None:
for action, line in self._log_actions:
self._info(f"{action.capitalize()} ({line})")
self._log_actions = [] | python | wandb/wandb_controller.py | 645 | 648 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,191 | print_debug | def print_debug(self) -> None:
for line in self._log_debug:
self._debug(line)
self._log_debug = [] | python | wandb/wandb_controller.py | 650 | 653 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,192 | print_space | def print_space(self) -> None:
self._warn("Method not implemented yet.") | python | wandb/wandb_controller.py | 655 | 656 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,193 | print_summary | def print_summary(self) -> None:
self._warn("Method not implemented yet.") | python | wandb/wandb_controller.py | 658 | 659 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,194 | _get_run_counts | def _get_run_counts(runs: List[sweeps.SweepRun]) -> Dict[str, int]:
metrics = {}
categories = [name for name, _ in sweeps.RunState.__members__.items()] + ["unknown"]
for r in runs:
state = r.state
found = "unknown"
for c in categories:
if state == c:
found... | python | wandb/wandb_controller.py | 662 | 674 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,195 | _get_runs_status | def _get_runs_status(metrics):
categories = [name for name, _ in sweeps.RunState.__members__.items()] + ["unknown"]
mlist = []
for c in categories:
if not metrics.get(c):
continue
mlist.append("%s: %d" % (c.capitalize(), metrics[c]))
s = ", ".join(mlist)
return s | python | wandb/wandb_controller.py | 677 | 685 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,196 | _sweep_status | def _sweep_status(
sweep_obj: dict,
sweep_conf: Union[dict, sweeps.SweepConfig],
sweep_runs: List[sweeps.SweepRun],
) -> str:
sweep = sweep_obj["name"]
_ = sweep_obj["state"]
run_count = len(sweep_runs)
run_type_counts = _get_run_counts(sweep_runs)
stopped = len([r for r in sweep_runs if... | python | wandb/wandb_controller.py | 688 | 721 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,197 | nested_shape | def nested_shape(array_or_tuple, seen=None):
"""Figure out the shape of tensors possibly embedded in tuples
i.e
[0,0] returns (2)
([0,0], [0,0]) returns (2,2)
(([0,0], [0,0]),[0,0]) returns ((2,2),2)
"""
if seen is None:
seen = set()
if hasattr(array_or_tuple, "size"):
# ... | python | wandb/wandb_torch.py | 18 | 46 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,198 | log_track_init | def log_track_init(log_freq: int) -> List[int]:
"""create tracking structure used by log_track_update"""
l = [0] * 2
l[LOG_TRACK_THRESHOLD] = log_freq
return l | python | wandb/wandb_torch.py | 52 | 56 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,199 | log_track_update | def log_track_update(log_track: int) -> bool:
"""count (log_track[0]) up to threshold (log_track[1]), reset count (log_track[0]) and return true when reached"""
log_track[LOG_TRACK_COUNT] += 1
if log_track[LOG_TRACK_COUNT] < log_track[LOG_TRACK_THRESHOLD]:
return False
log_track[LOG_TRACK_COUNT]... | python | wandb/wandb_torch.py | 59 | 65 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,200 | __init__ | def __init__(self):
global torch
torch = wandb.util.get_module("torch", "Could not import torch")
self._hook_handles = {}
self._num_bins = 64
self._is_cuda_histc_supported = None
self.hook_torch = TorchGraph.hook_torch | python | wandb/wandb_torch.py | 71 | 77 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.