This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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( | |
* { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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__() |