Skip to content

Instantly share code, notes, and snippets.

View stephenyan1231's full-sized avatar

Zhicheng Yan stephenyan1231

View GitHub Profile
@stephenyan1231
stephenyan1231 / classification_ema_task.py
Created March 14, 2021 19:38
/data/users/zyan3/fbsource/fbcode/fblearner/flow/projects/vision/classy_vision_workflows/classy_vision_arch_search/tasks/classification_ema_task.py
#!/usr/bin/env python3
import itertools
import math
from typing import Any, Dict, List, NamedTuple, Optional, Union # noqa
from classy_vision.hooks import ExponentialMovingAverageModelHook
from classy_vision.models import ClassyModel
from classy_vision.tasks import ClassificationTask, register_task
@stephenyan1231
stephenyan1231 / fine_tuning_ema_task.py
Created March 14, 2021 19:24
/classy_vision_workflows/classy_vision_arch_search/tasks/fine_tuning_ema_task.py
#!/usr/bin/env python3
from typing import Any, Dict
from classy_vision.tasks import FineTuningTask, register_task
from .classification_ema_task import ClassificationEMATask
@register_task("fine_tuning_ema_task")
@stephenyan1231
stephenyan1231 / probabilistic_nas_joint.py
Created March 13, 2021 23:41
20210313_probabilistic_nas_joint, fix arch score compute
#!/usr/bin/env python3
import copy
import enum
import logging
import multiprocessing as mp
import time
from typing import Any, Callable, Dict, List, NamedTuple, Optional, Union # noqa
import torch
@stephenyan1231
stephenyan1231 / probabilistic_nas.py
Created March 13, 2021 23:41
20210313_probabilistic_nas, fix arch score compute
#!/usr/bin/env python3
import copy
import logging
import multiprocessing as mp
import time
from typing import Any, Callable, Dict, List, NamedTuple, Optional, Union # noqa
import torch
import torch.distributed
@stephenyan1231
stephenyan1231 / f256407067_derived_signature.log
Created March 11, 2021 03:49
f256407067_derived_signature.log
I0310 18:40:34 16874 auto_x3d_search.py:818] Derived autox3d signature: {'stage0_group0_pathway0_block0': {'op_type': 'ir_k_t3s3_se', 'expansion': 3
.75, 'channel': 40}, 'stage0_group1_pathway0_block0': {'op_type': 'ir_k_t5s5_se', 'expansion': 3.75, 'channel': 40}, 'stage0_group1_pathway0_block1': {
'op_type': 'ir_k_t5s5_se', 'expansion': 3.75, 'channel': 40}, 'stage1_group0_pathway0_block0': {'op_type': 'ir_k_t1s3_se', 'expansion': 4.5, 'channel':
88}, 'stage1_group1_pathway0_block0': {'op_type': 'ir_k_t3s5_se', 'expansion': 6.0, 'channel': 88}, 'stage1_group1_pathway0_block1': {'op_type':
'ir_k_t3s5_se', 'expansion': 6.0, 'channel': 88}, 'stage1_group1_pathway0_block2': {'op_type': 'ir_k_t3s5_se', 'expansion': 6.0, 'channel': 88},
'stage1_group1_pathway0_block3': {'op_type': 'ir_k_t3s5_se', 'expansion': 6.0, 'channel': 88}, 'stage2_group0_pathway0_block0': {'op_type':
'ir_k_t1s5_se', 'expansion': 5.25, 'channel': 128}, 'stage2_group1_pathway0_block0': {'op_type': 'ir_k_t1s3_se', 'expansion': 3.75, 'cha
@stephenyan1231
stephenyan1231 / classy_fb_minikinetics200.py
Created March 7, 2021 21:59
/data/users/zyan3/fbsource/fbcode/fblearner/flow/projects/vision/classy_vision_workflows/classy_vision_arch_search/datasets/classy_fb_minikinetics200.py
#!/usr/bin/env python3
# (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
import logging
import os
from functools import partial
from multiprocessing.pool import ThreadPool
from typing import Any, Callable, Dict, Optional
import torch
@stephenyan1231
stephenyan1231 / video_clip_sampler.py
Created March 5, 2021 19:58
/data/users/zyan3/fbsource/fbcode/torch/fb/vision/transforms/video_clip_sampler.py
#!/usr/bin/env python3
import enum
import math
from typing import Dict, List
import numpy as np
import torch
import torchvision.io as io
@stephenyan1231
stephenyan1231 / classy_on_box_video_clips_dataset.py
Created March 5, 2021 19:57
/data/users/zyan3/fbsource/fbcode/deeplearning/projects/classy_vision/fb/dataset/classy_on_box_video_clips_dataset.py
#!/usr/bin/env python3
# (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
import collections.abc
import copy
import gc
import logging
import math
from collections import OrderedDict
from functools import partial
@stephenyan1231
stephenyan1231 / __init__.py
Created March 3, 2021 20:22
/data/users/zyan3/fbsource/fbcode/deeplearning/projects/classy_vision/fb/dataset/__init__.py
#!/usr/bin/env python3
# (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
from pathlib import Path
from classy_vision.dataset import build_dataset as oss_build_dataset
from classy_vision.generic.registry_utils import import_all_modules
def build_dataset(dataset_config):
@stephenyan1231
stephenyan1231 / datasets_classy_minikinetics200_test.py
Created March 3, 2021 18:02
/data/users/zyan3/fbsource/fbcode/fblearner/flow/projects/vision/classy_vision_workflows/classy_vision_arch_search/tests/datasets_classy_minikinetics200_test.py
#!/usr/bin/env python3
# (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
import os
import unittest
from fblearner.flow.projects.vision.classy_vision_workflows.classy_vision_arch_search.datasets import (
MiniKinetics200Dataset,
build_dataset,
)