mirror of
https://github.com/labmlai/annotated_deep_learning_paper_implementations.git
synced 2025-08-14 01:13:00 +08:00
cleanup some unused imports
This commit is contained in:
@ -41,7 +41,6 @@ import numpy as np
|
||||
from labml import experiment
|
||||
from labml.configs import option
|
||||
from labml_nn.cfr import History as _History, InfoSet as _InfoSet, Action, Player, CFRConfigs
|
||||
from labml_nn.cfr.infoset_saver import InfoSetSaver
|
||||
|
||||
# Kuhn poker actions are pass (`p`) or bet (`b`)
|
||||
ACTIONS = cast(List[Action], ['p', 'b'])
|
||||
|
@ -71,11 +71,7 @@
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
"import torch\n",
|
||||
"import torch.nn as nn\n",
|
||||
"\n",
|
||||
"from labml import experiment\n",
|
||||
"from labml.configs import option\n",
|
||||
"from labml_nn.diffusion.ddpm.experiment import Configs"
|
||||
],
|
||||
"outputs": [],
|
||||
|
@ -68,11 +68,7 @@
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
"import torch\n",
|
||||
"import torch.nn as nn\n",
|
||||
"\n",
|
||||
"from labml import experiment\n",
|
||||
"from labml.configs import option\n",
|
||||
"from labml_nn.normalization.deep_norm.experiment import Configs"
|
||||
],
|
||||
"outputs": [],
|
||||
|
@ -53,9 +53,6 @@
|
||||
"id": "0hJXx_g0wS2C"
|
||||
},
|
||||
"source": [
|
||||
"import torch\n",
|
||||
"import torch.nn as nn\n",
|
||||
"\n",
|
||||
"from labml import experiment\n",
|
||||
"from labml_nn.normalization.weight_standardization.experiment import CIFAR10Configs as Configs"
|
||||
],
|
||||
|
@ -26,8 +26,8 @@ The experiment uses [Generalized Advantage Estimation](gae.html).
|
||||
"""
|
||||
|
||||
import torch
|
||||
|
||||
from labml_nn.rl.ppo.gae import GAE
|
||||
from torch import nn
|
||||
|
||||
|
||||
class ClippedPPOLoss(nn.Module):
|
||||
@ -178,7 +178,7 @@ class ClippedPPOLoss(nn.Module):
|
||||
return -policy_reward.mean()
|
||||
|
||||
|
||||
class ClippedValueFunctionLoss(Module):
|
||||
class ClippedValueFunctionLoss(nn.Module):
|
||||
"""
|
||||
## Clipped Value Function Loss
|
||||
|
||||
|
@ -71,11 +71,7 @@
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
"import torch\n",
|
||||
"import torch.nn as nn\n",
|
||||
"\n",
|
||||
"from labml import experiment\n",
|
||||
"from labml.configs import option\n",
|
||||
"from labml_nn.transformers.basic.autoregressive_experiment import Configs"
|
||||
],
|
||||
"outputs": [],
|
||||
|
@ -67,11 +67,7 @@
|
||||
"id": "0hJXx_g0wS2C"
|
||||
},
|
||||
"source": [
|
||||
"import torch\n",
|
||||
"import torch.nn as nn\n",
|
||||
"\n",
|
||||
"from labml import experiment\n",
|
||||
"from labml.configs import option\n",
|
||||
"from labml_nn.transformers.fast_weights.experiment import Configs"
|
||||
],
|
||||
"outputs": [],
|
||||
@ -138,21 +134,21 @@
|
||||
},
|
||||
"source": [
|
||||
"experiment.configs(conf,\n",
|
||||
" # A dictionary of configurations to override\n",
|
||||
" {'tokenizer': 'character',\n",
|
||||
" 'text': 'tiny_shakespeare',\n",
|
||||
" 'optimizer.learning_rate': 1.0,\n",
|
||||
" 'optimizer.optimizer': 'Noam',\n",
|
||||
" 'prompt': 'It is',\n",
|
||||
" 'prompt_separator': '',\n",
|
||||
" # A dictionary of configurations to override\n",
|
||||
" {'tokenizer': 'character',\n",
|
||||
" 'text': 'tiny_shakespeare',\n",
|
||||
" 'optimizer.learning_rate': 1.0,\n",
|
||||
" 'optimizer.optimizer': 'Noam',\n",
|
||||
" 'prompt': 'It is',\n",
|
||||
" 'prompt_separator': '',\n",
|
||||
"\n",
|
||||
" 'train_loader': 'shuffled_train_loader',\n",
|
||||
" 'valid_loader': 'shuffled_valid_loader',\n",
|
||||
" 'train_loader': 'shuffled_train_loader',\n",
|
||||
" 'valid_loader': 'shuffled_valid_loader',\n",
|
||||
"\n",
|
||||
" 'seq_len': 128,\n",
|
||||
" 'epochs': 128,\n",
|
||||
" 'batch_size': 16,\n",
|
||||
" 'inner_iterations': 25})"
|
||||
" 'seq_len': 128,\n",
|
||||
" 'epochs': 128,\n",
|
||||
" 'batch_size': 16,\n",
|
||||
" 'inner_iterations': 25})"
|
||||
],
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
|
@ -13,13 +13,12 @@ You can find the download instructions
|
||||
Save the training images inside `carvana/train` folder and the masks in `carvana/train_masks` folder.
|
||||
"""
|
||||
|
||||
from torch import nn
|
||||
from pathlib import Path
|
||||
|
||||
import torch.utils.data
|
||||
import torchvision.transforms.functional
|
||||
from PIL import Image
|
||||
|
||||
import torch.utils.data
|
||||
from labml import lab
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user