我现在正在研究一种恢复数据的算法,但这种情况不允许神经网络

问题描述

以下代码显示了我面临的问题: '''

def fakeDataGenerator(chanNum=31):
#This function generates the data I want to recover and it shows the characters of the data I am working on. It's continuous and differentiable.
    peaks = random.sample(range(chanNum),random.choice(range(3,10)))
    peaks.append(chanNum)
    peaks.sort()
    out = [random.choice(range(-5,5))]
    delta = 1
    while len(out) < chanNum:
        if len(out) < peaks[0]:
            out.append(out[-1]+delta)
        elif len(out) == peaks[0]:
            delta *= -1
            peaks.pop(0)
    return out

originalData = torch.tensor(fakeDataGenerator(31)).reshape(1,31).float()

encoder = torch.rand((31,9)).float() #encoder here is something that messed the data up
code = torch.matmul(originalData,encoder) #here we get the code which is messed up by the encoder

decoder = torch.pinverse(encoder) #We can make use of the encoder matrix to decode the data.
#For example,here I apply pinverse to recover the data,but...

decoded = torch.matmul(code,decoder)
print(decoded - originalData)  #the result is no good.

能否利用原始数据和编码器的特性更好地恢复原始数据?该程序运行的环境不允许使用神经网络等复杂模型。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)