Pytorch 1.5.0 (#3973)
* Standard deviation can no longer be set to 0 * Remove torch pinned version * 9th instead of 10th, silly me
This commit is contained in:
2
setup.py
2
setup.py
@@ -67,7 +67,7 @@ extras["mecab"] = ["mecab-python3"]
|
|||||||
extras["sklearn"] = ["scikit-learn"]
|
extras["sklearn"] = ["scikit-learn"]
|
||||||
extras["tf"] = ["tensorflow"]
|
extras["tf"] = ["tensorflow"]
|
||||||
extras["tf-cpu"] = ["tensorflow-cpu"]
|
extras["tf-cpu"] = ["tensorflow-cpu"]
|
||||||
extras["torch"] = ["torch==1.4.0"]
|
extras["torch"] = ["torch"]
|
||||||
|
|
||||||
extras["serving"] = ["pydantic", "uvicorn", "fastapi", "starlette"]
|
extras["serving"] = ["pydantic", "uvicorn", "fastapi", "starlette"]
|
||||||
extras["all"] = extras["serving"] + ["tensorflow", "torch"]
|
extras["all"] = extras["serving"] + ["tensorflow", "torch"]
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ def _config_zero_init(config):
|
|||||||
configs_no_init = copy.deepcopy(config)
|
configs_no_init = copy.deepcopy(config)
|
||||||
for key in configs_no_init.__dict__.keys():
|
for key in configs_no_init.__dict__.keys():
|
||||||
if "_range" in key or "_std" in key or "initializer_factor" in key:
|
if "_range" in key or "_std" in key or "initializer_factor" in key:
|
||||||
setattr(configs_no_init, key, 0.0)
|
setattr(configs_no_init, key, 1e-10)
|
||||||
return configs_no_init
|
return configs_no_init
|
||||||
|
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ class ModelTesterMixin:
|
|||||||
for name, param in model.named_parameters():
|
for name, param in model.named_parameters():
|
||||||
if param.requires_grad:
|
if param.requires_grad:
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
param.data.mean().item(),
|
((param.data.mean() * 1e9).round() / 1e9).item(),
|
||||||
[0.0, 1.0],
|
[0.0, 1.0],
|
||||||
msg="Parameter {} of model {} seems not properly initialized".format(name, model_class),
|
msg="Parameter {} of model {} seems not properly initialized".format(name, model_class),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user