예제 #1
0
class AttentionLayer(Config):
    # Softmax temperature
    tau: float = 10.0
    # Config for the attention net. Final layer will be added automatically
    mlp_config: MLP = MLP(
        layers=(100, 50),
        activation=None
    )
    # Number of input views
    n_views: int = 2
예제 #2
0
from config.eamc.defaults import EAMCExperiment, EAMC, AttentionLayer, Discriminator, Loss, Optimizer

BACKBONE_MLP_LAYERS = (200, 200, 500)
CNN_LAYERS = (("conv", 5, 5, 32, "relu"), ("pool", 2, 2), ("conv", 5, 5, 64,
                                                           "relu"),
              ("pool", 2, 2), ("fc", 500), ("bn", ), ("relu", ))
CNN_BACKBONES = (
    CNN(layers=CNN_LAYERS, input_size=(1, 28, 28)),
    CNN(layers=CNN_LAYERS, input_size=(1, 28, 28)),
)

eamc_blobs_overlap = EAMCExperiment(
    dataset_config=Dataset(name="blobs_overlap"),
    model_config=EAMC(
        backbone_configs=(
            MLP(layers=[32, 32, 32], input_size=(2, )),
            MLP(layers=[32, 32, 32], input_size=(2, )),
        ),
        discriminator_config=Discriminator(mlp_config=MLP(layers=(32, 32,
                                                                  32))),
        loss_config=Loss(),
        cm_config=DDC(n_clusters=3),
        optimizer_config=Optimizer(lr_backbones=2e-4, lr_disc=1e-5)),
)

eamc_blobs_overlap_5 = EAMCExperiment(
    dataset_config=Dataset(name="blobs_overlap_5"),
    model_config=EAMC(
        backbone_configs=(
            MLP(layers=[32, 32, 32], input_size=(2, )),
            MLP(layers=[32, 32, 32], input_size=(2, )),
예제 #3
0
from config.defaults import Experiment, Dataset, SiMVC, MLP, DDC, Fusion, Loss, CoMVC

blobs_overlap = Experiment(
    dataset_config=Dataset(name="blobs_overlap"),
    model_config=SiMVC(
        backbone_configs=(
            MLP(layers=[32, 32, 32], input_size=(2, )),
            MLP(layers=[32, 32, 32], input_size=(2, )),
        ),
        fusion_config=Fusion(method="weighted_mean", n_views=2),
        cm_config=DDC(n_clusters=3),
        loss_config=Loss(funcs="ddc_1|ddc_2|ddc_3", ),
    ),
    n_runs=1,
    n_epochs=10,
)

blobs_overlap_contrast = Experiment(
    dataset_config=Dataset(name="blobs_overlap"),
    model_config=CoMVC(backbone_configs=(
        MLP(layers=[32, 32, 32], input_size=(2, )),
        MLP(layers=[32, 32, 32], input_size=(2, )),
    ),
                       fusion_config=Fusion(method="weighted_mean", n_views=2),
                       projector_config=None,
                       cm_config=DDC(n_clusters=3),
                       loss_config=Loss(funcs="ddc_1|ddc_2|ddc_3|contrast", )),
    n_runs=1,
)

blobs_overlap_5 = Experiment(
예제 #4
0
파일: voc.py 프로젝트: DanielTrosten/mvc
from config.defaults import Experiment, Dataset, SiMVC, DDC, Fusion, MLP, Loss, CoMVC, Optimizer

voc = Experiment(
    dataset_config=Dataset(name="voc"),
    model_config=SiMVC(
        backbone_configs=(
            MLP(input_size=(512,)),
            MLP(input_size=(399,)),
        ),
        fusion_config=Fusion(method="weighted_mean", n_views=2),
        cm_config=DDC(n_clusters=20),
        loss_config=Loss(
            funcs="ddc_1|ddc_2|ddc_3",
        ),
        optimizer_config=Optimizer(learning_rate=1e-3, scheduler_step_size=50, scheduler_gamma=0.1)
    ),
)

voc_contrast = Experiment(
    dataset_config=Dataset(name="voc"),
    model_config=CoMVC(
        backbone_configs=(
            MLP(input_size=(512,)),
            MLP(input_size=(399,)),
        ),
        projector_config=None,
        fusion_config=Fusion(method="weighted_mean", n_views=2),
        cm_config=DDC(n_clusters=20),
        loss_config=Loss(
            funcs="ddc_1|ddc_2|ddc_3|contrast",
        ),
예제 #5
0
파일: ccv.py 프로젝트: DanielTrosten/mvc
from config.defaults import Experiment, SiMVC, DDC, Fusion, MLP, Loss, Dataset, CoMVC, Optimizer

ccv = Experiment(
    dataset_config=Dataset(name="ccv"),
    model_config=SiMVC(backbone_configs=(
        MLP(input_size=(5000, )),
        MLP(input_size=(5000, )),
        MLP(input_size=(4000, )),
    ),
                       fusion_config=Fusion(method="weighted_mean", n_views=3),
                       cm_config=DDC(n_clusters=20),
                       loss_config=Loss(funcs="ddc_1|ddc_2|ddc_3", ),
                       optimizer_config=Optimizer()),
)

ccv_contrast = Experiment(
    dataset_config=Dataset(name="ccv"),
    model_config=CoMVC(backbone_configs=(
        MLP(input_size=(5000, )),
        MLP(input_size=(5000, )),
        MLP(input_size=(4000, )),
    ),
                       fusion_config=Fusion(method="weighted_mean", n_views=3),
                       projector_config=None,
                       cm_config=DDC(n_clusters=20),
                       loss_config=Loss(funcs="ddc_1|ddc_2|ddc_3|contrast",
                                        delta=20.0),
                       optimizer_config=Optimizer(scheduler_step_size=50,
                                                  scheduler_gamma=0.1)),
    n_epochs=100)
예제 #6
0
파일: rgbd.py 프로젝트: DanielTrosten/mvc
from config.defaults import Experiment, Dataset, SiMVC, DDC, Fusion, MLP, Loss, CoMVC, Optimizer


rgbd = Experiment(
    dataset_config=Dataset(name="rgbd"),
    model_config=SiMVC(
        backbone_configs=(
            MLP(input_size=(2048,)),
            MLP(input_size=(300,)),
        ),
        fusion_config=Fusion(method="weighted_mean", n_views=2),
        cm_config=DDC(n_clusters=13),
        loss_config=Loss(
            funcs="ddc_1|ddc_2|ddc_3",
        )
    ),
)

rgbd_contrast = Experiment(
    dataset_config=Dataset(name="rgbd"),
    model_config=CoMVC(
        backbone_configs=(
            MLP(input_size=(2048,)),
            MLP(input_size=(300,)),
        ),
        fusion_config=Fusion(method="weighted_mean", n_views=2),
        projector_config=None,
        cm_config=DDC(n_clusters=13),
        loss_config=Loss(
            funcs="ddc_1|ddc_2|ddc_3|contrast",
        ),
예제 #7
0
class Discriminator(Config):
    # Config for the discriminator
    mlp_config: MLP = MLP(
        layers=(256, 256, 128),
        activation="leaky_relu:0.2"
    )