Skip to content

Mapping learned weights to PCMs #698

Closed Answered by coreylammie
maicoldubbio asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @maicoldubbio,

Great question! Here is a complete example of how all the scales can be extracted and MVMs can be performed using PWM and conductance values for the first tile of example 25 (https://github.com/IBM/aihwkit/blob/master/examples/25_torch_tile_lenet5_hardware_aware.py):

import torch
import aihwkit
import functools
from 25_torch_tile_lenet5_hardware_aware import (
    populate_rpu_config,
    create_analog_network,
    load_images,
)
from aihwkit.simulator.presets import StandardHWATrainingPreset
from aihwkit.nn.conversion import convert_to_digital
import matplotlib.pyplot as plt
import numpy as np


def det_l2_error(predicted_tensor, truth_tensor, axis=None):
    def det_no…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@maicoldubbio
Comment options

@maljoras
Comment options

Answer selected by maicoldubbio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants