Skip to content

Add text style transfer #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Dec 9, 2019
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9e45a3c
initial commit
swapnull7 Nov 27, 2019
277aa84
Merge branch 'master' into add-text-style-transfer
swapnull7 Nov 27, 2019
5ad14e3
bug fixes and adjusting conv inputs
swapnull7 Dec 3, 2019
b99aacc
separate forward function for Discriminator and Generator and disable…
swapnull7 Dec 4, 2019
258753c
remove debugger statement
swapnull7 Dec 4, 2019
44db04a
bug fix
swapnull7 Dec 4, 2019
b3711a8
detaching stuff before accumulating
swapnull7 Dec 4, 2019
d42929e
refactor and add component as optional parameter
swapnull7 Dec 4, 2019
f849833
Add optimizer for and backprop against encoder
swapnull7 Dec 4, 2019
28f2fec
Add in README
swapnull7 Dec 4, 2019
37cee30
Merge remote-tracking branch 'upstream/master' into add-text-style-tr…
swapnull7 Dec 4, 2019
9eb4c97
more fixes to eval mode
swapnull7 Dec 5, 2019
6dcc7fb
create optimizers so that they can be saved
swapnull7 Dec 5, 2019
4d38ff4
fix typo
swapnull7 Dec 5, 2019
c5f9ac6
Merge branch 'master' into add-text-style-transfer
swapnull7 Dec 5, 2019
20b6aa5
linting issues
swapnull7 Dec 5, 2019
fde2163
Merge branch 'master' into add-text-style-transfer
swapnull7 Dec 5, 2019
1b16c48
add type annottation for encoder
swapnull7 Dec 5, 2019
a344e52
fix linting
swapnull7 Dec 5, 2019
6a7a2b4
Isolate AE in training
swapnull7 Dec 6, 2019
9c3b7d3
works after changing the learning rate
swapnull7 Dec 8, 2019
8256ed7
remove debugger
swapnull7 Dec 8, 2019
ef36abd
Merge branch 'master' into add-text-style-transfer
swapnull7 Dec 8, 2019
59fc4f7
Reviewed changes
swapnull7 Dec 9, 2019
2b65b9e
linting
swapnull7 Dec 9, 2019
5cf695a
Merge branch 'master' into add-text-style-transfer
swapnull7 Dec 9, 2019
e91266e
improving typechecks
swapnull7 Dec 9, 2019
722a51c
linting
swapnull7 Dec 9, 2019
2a18dd4
Merge branch 'master' into add-text-style-transfer
swapnull7 Dec 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions texar/torch/utils/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
Utility functions related to variables.
"""

from typing import Any, List, Tuple, Union
from typing import List, Tuple, Union
import torch.nn as nn

from texar.torch.module_base import ModuleBase

__all__ = [
"add_variable",
Expand All @@ -24,8 +27,8 @@


def add_variable(
variable: Union[List[Any], Tuple[Any]],
var_list: List[Any]):
variable: Union[List[nn.Parameter], Tuple[nn.Parameter]],
var_list: List[nn.Parameter]):
r"""Adds variable to a given list.

Args:
Expand All @@ -40,7 +43,7 @@ def add_variable(


def collect_trainable_variables(
modules: Union[Any, List[Any]]
modules: Union[ModuleBase, List[ModuleBase]]
):
r"""Collects all trainable variables of modules.

Expand All @@ -57,7 +60,7 @@ def collect_trainable_variables(
if not isinstance(modules, (list, tuple)):
modules = [modules]

var_list: List[Any] = []
var_list: List[nn.Parameter] = []
for mod in modules:
add_variable(mod.trainable_variables, var_list)

Expand Down