Skip to content

Instantly share code, notes, and snippets.

@gasvn
gasvn / main.py
Created July 3, 2020 08:32
training res2net on cifar100
#coding:utf-8
import argparse
import os
import random
import shutil
import time
import warnings
import torch
import torch.nn as nn
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch
import torch.nn.functional as F
__all__ = ['Res2Net', 'res2net50_v1b', 'res2net101_v1b']
model_urls = {
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
import math
# This version is only shown as a example. It has some differences with the ImageNet version of Res2Next.
class ResNeXtBottleneck(nn.Module):
expansion = 4
"""
RexNeXt bottleneck type C (https://github.com/facebookresearch/ResNeXt/blob/master/models/resnext.lua)
@gasvn
gasvn / ssh-tunnel@.service
Created December 19, 2018 01:22 — forked from guettli/ssh-tunnel@.service
Reliable persistent SSH-Tunnel via systemd (not autossh)
# Reliable persistent SSH-Tunnel via systemd (not autossh)
# https://gist.github.com/guettli/31242c61f00e365bbf5ed08d09cdc006#file-ssh-tunnel-service
[Unit]
Description=Tunnel for %i
After=network.target
[Service]
User=tunnel
ExecStart=/usr/bin/ssh -o "ExitOnForwardFailure yes" -o "ServerAliveInterval 60" -N tunnel@%i