Browse Source

General changes for development environment

master
Fazil Altinel 4 years ago
parent
commit
26fdf67924
  1. 2
      .gitignore
  2. 3
      README.md
  3. BIN
      adversarial.png
  4. 33
      altutils.py
  5. BIN
      target_domain.png

2
.gitignore

@ -117,3 +117,5 @@ dmypy.json
# Pyre type checker
.pyre/
.vscode

3
README.md

@ -1,6 +1,7 @@
# ADDA.PyTorch
implement Adversarial Discriminative Domain Adapation in PyTorch
This repo is mostly based on https://github.com/Fujiki-Nakamura/ADDA.PyTorch
## Example
```
@ -8,7 +9,6 @@ $ python train_source.py --logdir outputs
$ python main.py --logdir outputs --trained outputs/best_model.pt --slope 0.2
```
## Result
### SVHN -> MNIST
| | Paper | This Repro |
@ -21,3 +21,4 @@ $ python main.py --logdir outputs --trained outputs/best_model.pt --slope 0.2
## Resource
- https://arxiv.org/pdf/1702.05464.pdf
- https://github.com/Fujiki-Nakamura/ADDA.PyTorch

BIN
adversarial.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

33
altutils.py

@ -0,0 +1,33 @@
import configparser
import logging
def readConfigFile(filePath):
"""
Read config file
Args:
filePath ([str]): path to config file
Returns:
[Obj]: config object
"""
config = configparser.ConfigParser()
config.read(filePath)
return config
def setLogger(logFilePath):
"""
Set logger
Args:
logFilePath ([str]): path to log file
Returns:
[obj]: logger object
"""
logHandler = [logging.FileHandler(logFilePath), logging.StreamHandler()]
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(message)s", handlers=logHandler)
logger = logging.getLogger()
return logger

BIN
target_domain.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Loading…
Cancel
Save