Coder Social home page Coder Social logo

homura's Introduction

About!

I'm Ryuichiro Hataya, PhD, a postdoctoral researcher at RIKEN AIP (High-Dimensional Causal Analysis Team).

News

  • Our papers "Transformers as Stochastic Optimizers" (Hataya & Imaizumi) and "Automatic Domain Adaptation by Transformers in In-Context Learning" (Hataya & Matsui & Imaizumi) have been accepted at the ICML 2024 Workshop on In-Context Learning.
  • I will visit CENTAI @ Torino🇮🇹.
  • I will visit Wien🇦🇹 to attend ICML.
  • I will visit Aix-Marseille University @ Marseille🇫🇷.
  • I will visit A*STAR CFAR @ Singapore🇸🇬.
  • Our paper "Self-attention Networks Localize When QK-eigenspectrum Concentrates" is accepted at ICML.
  • I will attend FIMI @ Bristol🇬🇧.
  • I will attend DLWS @ Tokyo🇯🇵.
  • I will attend MLSS @ Okinawa🇯🇵 as an organizer.
  • Our paper “Sketch-based Semantic Retrieval of Medical Images” (Kobayashi et al.) has been accepted at Medical Image Analysis.
  • I will attend QTML @ Geneve🇨🇭.
  • I will visit Nicolaus Copernicus University Poland @ Torun🇵🇱 from Sep 25th to 30th and then attend ICCV @ Paris🇫🇷.
  • I will visit the Okinawa Institute of Science and Technology🇯🇵 from Aug 29th to Sep 1st.
  • Our paper "An Empirical Investigation of Pre-trained Model Selection for Out-of-Distribution Generalization and Calibration" is accepted at ICCV 2023 Workshop on Uncertainty Quantification for Computer Vision.
  • Our paper "Will Large-scale Generative Models Corrupt Future Datasets?" is accepted at ICCV 2023.
  • Our paper "Towards AI-driven radiology education: A self-supervised segmentation-based framework for high-precision medical image editing" is accepted at MICCAI 2023.
  • I will attend AISTATS @ València🇪🇸 at the end of April and visit IIT @ Genova🇮🇹 at the beginning of May.
  • I will visit the Vietnam Institute for Advanced Study in Mathematics @ Ha Noi🇻🇳 on April 2023.
  • I will visit EPFL CIS @ Lausanne🇨🇭 and Fraunhofer IIS @ Nürnberg🇩🇪 from 8th to 15th March 2023.
  • Our paper "Nyström Method for Accurate and Scalable Implicit Differentiation" is accepted at AISTATS 2023.
  • I received a doctoral degree as a representative student of the Graduate School of Information Science and Technology, UTokyo.
  • I visted at IIT @ Genova on July 2022.
  • I successfully defended my PhD thesis!
  • Our paper "DJMix: Unsupervised Task-agnostic Image Augmentation for Improving Robustness of Convolutional Neural Networks" is accepted at IJCNN 2022.
  • I am promoted to Excellent Research Assistant @ UTokyo.
  • Our paper "Meta Approach to Data Augmentation Optimization" has been accepted to WACV 2022.

Stats

My github stats Top Langs

homura's People

Contributors

actions-user avatar levelfour avatar moskomule avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

homura's Issues

dataset DataSet(root, train, transform, download) is expected, but <class 'torchvision.datasets.cifar.CIFAR10'> has arguments of set() instead.

Traceback (most recent call last):
File "cifar.py", line 3, in
from homura import callbacks, lr_scheduler, optim, reporters
File "/home/x/anaconda3/envs/senetv38/lib/python3.8/site-packages/homura/init.py", line 8, in
Registry.import_modules('homura.vision')
File "/home/x/anaconda3/envs/senetv38/lib/python3.8/site-packages/homura/register.py", line 97, in import_modules
module = importlib.import_module(package_name)
File "/home/x/anaconda3/envs/senetv38/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/x/anaconda3/envs/senetv38/lib/python3.8/site-packages/homura/vision/init.py", line 2, in
from .data import DATASET_REGISTRY
File "/home/x/anaconda3/envs/senetv38/lib/python3.8/site-packages/homura/vision/data/init.py", line 2, in
from .datasets import VisionSet, DATASET_REGISTRY
File "/home/x/anaconda3/envs/senetv38/lib/python3.8/site-packages/homura/vision/data/datasets.py", line 230, in
{'cifar10': VisionSet(datasets.CIFAR10, "~/.torch/data/cifar10", 10,
File "", line 9, in init
File "/home/x/anaconda3/envs/senetv38/lib/python3.8/site-packages/homura/vision/data/datasets.py", line 86, in post_init
raise RuntimeError(f"dataset DataSet(root, train, transform, download) is expected, "
RuntimeError: dataset DataSet(root, train, transform, download) is expected, but <class 'torchvision.datasets.cifar.CIFAR10'> has arguments of set() instead.

ImportError: cannot import name 'CosineAnnealingWarmRestarts'

Hello, as I import homura, I got this issue
'''

import homura
Traceback (most recent call last):
File "", line 1, in
File "/home/wangwen/anaconda3/envs/py36/lib/python3.6/site-packages/homura/init.py", line 3, in
from . import callbacks, debug, liblog, lr_scheduler, optim, reporters, trainers, metrics, modules, utils, vision
File "/home/wangwen/anaconda3/envs/py36/lib/python3.6/site-packages/homura/lr_scheduler.py", line 5, in
from torch.optim.lr_scheduler import (StepLR as _StepLR, MultiStepLR as _MultiStepLR, LambdaLR as _LambdaLR,
ImportError: cannot import name 'CosineAnnealingWarmRestarts'
'''

About the pip install homura under conda env

Hi I install through pip install -U git+https://github.com/moskomule/homura, and update setuptools in conda environment, but faced the issue as below:

(py36) [ychan@server]$ pip install -U git+https://github.com/moskomule/homura
Collecting git+https://github.com/moskomule/homura
Cloning https://github.com/moskomule/homura to /tmp/pip-req-build-lyxuuvoc
Running command git clone -q https://github.com/moskomule/homura /tmp/pip-req-build-lyxuuvoc
ERROR: Command errored out with exit status 1:
command: /home/csgrad/ychan/anaconda3/envs/py36/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-lyxuuvoc/setup.py'"'"'; file='"'"'/tmp/pip-req-build-lyxuuvoc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-sm_mm7_d
cwd: /tmp/pip-req-build-lyxuuvoc/
Complete output (7 lines):
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-req-build-lyxuuvoc/setup.py", line 4, in
readme = f.read()
File "/home/csgrad/ychan/anaconda3/envs/py36/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 388: ordinal not in range(128)
----------------------------------------
WARNING: Discarding git+https://github.com/moskomule/homura. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Do anyone know how to fix it? Thanks

WIN10, pip install git+https://github.com/moskomule/homura UnicodeDecodeError: 'gbk' codec can't decode byte

pip install git+https://github.com/moskomule/homura
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting git+https://github.com/moskomule/homura
Cloning https://github.com/moskomule/homura to c:\users\tenglong\appdata\local\temp\pip-req-build-cv6aijof
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\TengLong\AppData\Local\Temp\pip-req-build-cv6aijof\setup.py", line 4, in
readme = f.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xb0 in position 271: illegal multibyte sequence

How to assign GPU id?

I want to train cifar10 with two gpus. How to assign the training process with specific two gpus?

0.2

  • Use ABCMeta for abstract classes
  • Use decorator for a simpler interface.
  • Add simple tests as much as possible
  • Documentation

How to use mixup for training

    tqdm_rep = reporters.TQDMReporter(range(args.epochs), callbacks=[callbacks.AccuracyCallback(1)])
       trainer = Trainer(model, optimizer, F.cross_entropy, scheduler=scheduler, callbacks=[tqdm_rep])
       for _ in tqdm_rep:
            trainer.train(train_loader)
            trainer.test(test_loader)

How to use mixup augmentation methods for training.

ValueError: not enough values to unpack (expected 2, got 1)

hello,
when i call trainer.train(customdataloader),i get error following:
File "cifar.py", line 40, in | 0/11143 [00:00<?, ?it/s]
main()
File "cifar.py", line 27, in main
trainer.train(trainloader)
File "/home/lab205/anaconda3/envs/senet/lib/python3.7/site-packages/homura/trainers.py", line 236, in train
self._loop(data_loader, mode=mode)
File "/home/lab205/anaconda3/envs/senet/lib/python3.7/site-packages/homura/trainers.py", line 215, in _loop
self._iteration(data, mode)
File "/home/lab205/anaconda3/envs/senet/lib/python3.7/site-packages/homura/trainers.py", line 182, in _iteration
results = self.iteration(data)
File "/home/lab205/anaconda3/envs/senet/lib/python3.7/site-packages/homura/trainers.py", line 336, in iteration
input, target = data
ValueError: not enough values to unpack (expected 2, got 1)

but i am sure that
(for data in customdataloader) the lenth is 2

More simple APIs

Callbacks and reporters are not simple enough.

Trainer.iteration should be something like

class SupervisedTrainer(TrainerBase):
...
def iteration(self, data):
    input, target = data
    output = self.model(input)
    loss = self.loss_f(output, target)
    if self.is_train:
        self.optimizer.zero_grad()
        loss.backward()
        self.optimizer.ste()
    self.report('loss', loss)
    self.report('accuracy', homura.accuracy(output, target))

Then, a simple training code is like

def main(cfg):
    model = MODEL_REGISTRY...
    dataset = DATASET_REGISTRY...
    train_loader, test_loader = dataset(...)
    optimizer = ...
    trainer = Trainer(model, optimizer, loss_f)
    trainer.add_callbacks(...)  # reporters other than TQDMReporter
    for ep in trainer.epoch_iters:
        trainer.train(...)

How to resolve the exception: AssertionError: root does not exist

Traceback (most recent call last):
File "/home/fxz/gitRepos/senet.pytorch/cifar.py", line 39, in
main()
File "/home/fxz/gitRepos/senet.pytorch/cifar.py", line 11, in main
train_loader, test_loader = DATASET_REGISTRY("cifar10")(args.batch_size, num_workers=args.num_workers)
File "/home/fxz/.local/lib/python3.8/site-packages/homura/vision/data/datasets.py", line 237, in get_dataloader
train_set, test_set, val_set = self.get_dataset(train_size, test_size, val_size,
File "/home/fxz/.local/lib/python3.8/site-packages/homura/vision/data/datasets.py", line 145, in get_dataset
assert (download or self.root.exists()), "root does not exist"
AssertionError: root does not exist

Easy Trainer override

Add add_end_epoch(self, name, value) etc. Then overrideing iteration, loop will be easier.

def iteration(self, data: Iterable[torch.Tensor], is_train: bool) -> Iterable[torch.Tensor]:
        input, target = self.to_device(data)
        self.add_start_epoch("input", input)
        output = self.model(input)
        loss = self.loss_f(output, target)
        if is_train:
            self.optimizer.zero_grad()
            loss.backward()
            self.optimizer.step()
        return loss, output

TypeError: `scheduler.func` is expected to be subclass of `_LRScheduler` but got <class 'type'>

when i added cifar-10 datasets to the ~/.torch/data. then i run the cifar.py ,it remind me this error:

D:\Installation\ANACONDA\envs\senet\python.exe E:\study\AI_acc\senet.pytorch-master\cifar.py
Files already downloaded and verified
Files already downloaded and verified
0%| | 0/200 [00:00<?, ?it/s]Traceback (most recent call last):
File "E:\study\AI_acc\senet.pytorch-master\cifar.py", line 38, in
main()
File "E:\study\AI_acc\senet.pytorch-master\cifar.py", line 22, in main
with Trainer(model, optimizer, F.cross_entropy, scheduler=scheduler, callbacks=_callbacks) as trainer:
File "D:\Installation\ANACONDA\envs\senet\lib\site-packages\homura\trainers.py", line 519, in init
super(SupervisedTrainer, self).init(model, optimizer, loss_f, callbacks=callbacks, scheduler=scheduler,
File "D:\Installation\ANACONDA\envs\senet\lib\site-packages\homura\trainers.py", line 122, in init
self.set_scheduler()
File "D:\Installation\ANACONDA\envs\senet\lib\site-packages\homura\trainers.py", line 454, in set_scheduler
raise TypeError(f"scheduler.func is expected to be subclass of _LRScheduler"
TypeError: scheduler.func is expected to be subclass of _LRScheduler but got <class 'type'>
0%| | 0/200 [00:00<?, ?it/s]

Process finished with exit code 1

GPU memory leak?

While DDP training, GPU memory consumption gradually and slowly grows.

Give a ERROR

When I use the package, it give a error about ImportError: cannot import name 'callbacks' from 'homura'.Why?

raise KeyError( KeyError: 'Name resnet20 is already used, try another name!'

run cifar.py always remind me this error:
raise KeyError( KeyError: 'Name resnet20 is already used, try another name!'
it seems like error in register.py

`
def register_from_dict(self,
name_to_func: Dict[str, Callable]):
for k, v in name_to_func.items():
self.register(v, name=k)

def register(self,
             func: Callable = None,
             *,
             name: Optional[str] = None):
    if func is None:
        return functools.partial(self.register, name=name)

    _type = self.type
    if _type is not None and not isinstance(_type, types.FunctionType):
        if not (isinstance(func, _type) or issubclass(func, _type)):
            raise TypeError(
                f'`func` is expected to be subclass of {_type}.')

    if name is None:
        name = func.__name__

    if self._registry.get(name) is not None:
        raise KeyError(
            f'Name {name} is already used, try another name!')

`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.