Exemplo n.º 1
0
class TTv2EcRamMOPreset(UnitCellRPUConfig):
    """Configuration using TTv2 with
    :class:`~aihwkit.simulator.presets.devices.EcRamMOPresetDevice`.

    See :class:`~aihwkit.simulator.configs.devices.BufferedTransferCompound`
    for details on TTv2-like optimizers.

    The default peripheral hardware
    (:class:`~aihwkit.simulator.presets.utils.PresetIOParameters`) and
    analog update
    (:class:`~aihwkit.simulator.presets.utils.PresetUpdateParameters`)
    configuration is used otherwise.
    """

    device: UnitCell = field(
        default_factory=lambda: BufferedTransferCompound(
            unit_cell_devices=[EcRamMOPresetDevice(), EcRamMOPresetDevice()],
            transfer_forward=PresetIOParameters(),
            transfer_update=PresetUpdateParameters(),
            transfer_every=1.0,
            units_in_mbatch=True,
            ))
    forward: IOParameters = field(default_factory=PresetIOParameters)
    backward: IOParameters = field(default_factory=PresetIOParameters)
    update: UpdateParameters = field(default_factory=PresetUpdateParameters)
Exemplo n.º 2
0
class EcRamMO4Preset(UnitCellRPUConfig):
    """Preset configuration using four metal-oxide EcRam devices per cross-point
    (:class:`~aihwkit.simulator.presets.devices.EcRamMOPresetDevice`),
    where both are updated with random selection policy for update.

    See :class:`~aihwkit.simulator.configs.devices.VectorUnitCell` for
    more details on multiple devices per cross-points.

    The default peripheral hardware
    (:class:`~aihwkit.simulator.presets.utils.PresetIOParameters`) and
    analog update
    (:class:`~aihwkit.simulator.presets.utils.PresetUpdateParameters`)
    configuration is used otherwise.
    """

    device: UnitCell = field(default_factory=lambda: VectorUnitCell(
        unit_cell_devices=[
            EcRamMOPresetDevice(),
            EcRamMOPresetDevice(),
            EcRamMOPresetDevice(),
            EcRamMOPresetDevice()
        ],
        update_policy=VectorUnitCellUpdatePolicy.SINGLE_RANDOM))
    forward: IOParameters = field(default_factory=PresetIOParameters)
    backward: IOParameters = field(default_factory=PresetIOParameters)
    update: UpdateParameters = field(default_factory=PresetUpdateParameters)
Exemplo n.º 3
0
class MixedPrecisionEcRamMOPreset(DigitalRankUpdateRPUConfig):
    """Configuration using Mixed-precision with
    class:`~aihwkit.simulator.presets.devices.EcRamMOPresetDevice`.

    See class:`~aihwkit.simulator.configs.devices.MixedPrecisionCompound`
    for details on the mixed precision optimizer.

    The default peripheral hardware
    (:class:`~aihwkit.simulator.presets.utils.PresetIOParameters`) and
    analog update
    (:class:`~aihwkit.simulator.presets.utils.PresetUpdateParameters`)
    configuration is used otherwise.
    """

    device: DigitalRankUpdateCell = field(
        default_factory=lambda: MixedPrecisionCompound(
            device=EcRamMOPresetDevice(), ))
    forward: IOParameters = field(default_factory=PresetIOParameters)
    backward: IOParameters = field(default_factory=PresetIOParameters)
    update: UpdateParameters = field(default_factory=PresetUpdateParameters)
Exemplo n.º 4
0
    PCMPresetUnitCell,
)

plt.ion()

# Note alternatively one can use plot_device_compact for a more compact
# plot.

# Idealized
plot_device(IdealizedPresetDevice(), n_steps=10000)

# ReRam based on ExpStep
plot_device(ReRamESPresetDevice(), n_steps=1000)

# ReRam based on SoftBounds
plot_device(ReRamSBPresetDevice(), n_steps=1000)

# Capacitor
plot_device(CapacitorPresetDevice(), n_steps=400)

# ECRAM
plot_device(EcRamPresetDevice(), n_steps=1000)

# Mo-ECRAM
plot_device(EcRamMOPresetDevice(), n_steps=8000)

# PCM
plot_device(PCMPresetUnitCell(), n_steps=80)

plt.show()