Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This server simply bombards each websocket connection with a message every millisecond up to 20k messages. | |
How to run. | |
1. Run pushpin locally with the default publish port and backend port as 8080. | |
ex: pushpin --merge-output --port=17999 --route="* localhost:8080,over_http" --config pushpin.conf | |
2. Start this server in another terminal | |
ex: node loadtest.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def training_step(self, batch: DataPoint, batch_idx: int) -> pl.TrainResult: | |
planes, target_move, target_val = batch | |
pred_move, pred_val = self(planes) | |
mse_loss, cross_entropy_loss, loss = self.loss( | |
pred_move, pred_val, target_move, target_val | |
) | |
result = pl.TrainResult(minimize=loss) | |
result.log("train_loss", loss, prog_bar=True) | |
result.log_dict( | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def training_step(self, batch: DataPoint, batch_idx: int) -> pl.TrainResult: | |
planes, target_move, target_val = batch | |
pred_move, pred_val = self(planes) | |
mse_loss, cross_entropy_loss, loss = self.loss( | |
pred_move, pred_val, target_move, target_val | |
) | |
result = pl.TrainResult(minimize=loss) | |
result.log("train_loss", loss, prog_bar=True) | |
result.log_dict( | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DataModule(pl.LightningDataModule): | |
def __init__( | |
self, | |
train_data_dir: str, | |
val_data_dir: str, | |
test_data_dir: str, | |
train_dataloader_conf: Optional[DictConfig] = None, | |
val_dataloader_conf: Optional[DictConfig] = None, | |
test_dataloader_conf: Optional[DictConfig] = None, | |
): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @package _group_ | |
_target_: leela_zero_pytorch.network.NetworkLightningModule | |
network_conf: | |
residual_channels: 32 | |
residual_layers: 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @package _group_ | |
_target_: leela_zero_pytorch.network.NetworkLightningModule | |
network_conf: | |
residual_channels: 128 | |
residual_layers: 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@hydra.main(config_path="conf", config_name="config") | |
def main(cfg: DictConfig) -> Trainer: | |
logger.info(f"Training with the following config:\n{OmegaConf.to_yaml(cfg)}") | |
network = instantiate(cfg.network, cfg.train) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pytest.mark.parametrize("network_size", ["small", "big", "huge"]) | |
def test_train_network_size(monkeypatch, tmp_path, capsys, network_size): | |
with initialize(config_path="../leela_zero_pytorch/conf"): | |
cfg = compose( | |
config_name="config", | |
overrides=[ | |
f"+network={network_size}", | |
"data.train_data_dir=tests/test-data", | |
"data.train_dataloader_conf.batch_size=2", | |
"data.val_data_dir=tests/test-data", |
OlderNewer