示例#1
0
 def get_layer(self, cols, rows):
     """Return a layer."""
     return AnalogLinear(
         cols,
         rows,
         bias=True,
         resistive_device=ConstantStepResistiveDevice()).cuda()
示例#2
0
 def get_layer(self, cols, rows):
     """Return a layer."""
     return AnalogLinear(
         cols,
         rows,
         bias=True,
         resistive_device=FloatingPointResistiveDevice()).cuda()
示例#3
0
 def get_layer(self, cols=3, rows=4, **kwargs):
     """Return a layer."""
     # pylint: disable=arguments-differ
     return AnalogLinear(cols,
                         rows,
                         resistive_device=ConstantStepResistiveDevice(
                             ConstantStepResistiveDeviceParameters(
                                 w_max_dtod=0, w_min_dtod=0)),
                         **kwargs).cuda()
示例#4
0
 def get_model(self, **kwargs):
     """Return a layer."""
     if 'resistive_device' not in kwargs:
         kwargs['resistive_device'] = ConstantStepResistiveDevice()
     return AnalogLinear(in_features=5, out_features=3, **kwargs).cuda()
示例#5
0
 def get_model(self, **kwargs):
     """Return a layer."""
     if 'resistive_device' not in kwargs:
         kwargs['resistive_device'] = FloatingPointResistiveDevice()
     return AnalogLinear(in_features=5, out_features=3, **kwargs)