Skip to content

Instantly share code, notes, and snippets.

@mjdietzx
mjdietzx / ResNeXt_pytorch.py
Created May 3, 2017 18:32
pyt🔥rch implementation of ResNeXt
import torch
from torch.autograd import Variable
import torch.nn as nn
class Bottleneck(nn.Module):
cardinality = 32 # the size of the set of transformations
def __init__(self, nb_channels_in, nb_channels, nb_channels_out, stride=1):
super().__init__()
@dgca
dgca / useDispatchMethods.js
Last active August 12, 2022 19:17
Abstraction over `useReducer` to make writing reducer functions easier and without switch statements.
/**
* Abstraction over `useReducer` to make writing reducer functions easier and without
* switch statements.
*
* @see https://codesandbox.io/s/usedispatchmethods-wwkcw?file=/src/App.js
* @example
*
* const Thinger = () => {
* const [state, dispatch] = useDispatchMethods(
* {