视频预测论文(GAN)(1)-DEEP MULTI-SCALE VIDEO PREDICTION BEYOND MEAN SQUARE ERROR

准备就一系列论文的学习写博客,方便自己查找。

这是第一篇

DEEP MULTI-SCALE VIDEO PREDICTION BEYOND MEAN SQUARE ERROR

这篇我主要关注通过gan网络生成的预测


首先我们的输入包括真实前置帧X,真实待预测帧Y,生成器G,判别器D
在训练判别器时,我们将真实的X,Y打包成(X,Y)
在训练生成器时,我们将X与高斯分布Y’打包得到(X,G(X))并将它作为输入
输入判别器中
判别器的训练

我们将真实待预测帧定义为1,将生成器生成帧定义为0
对于真实图片,我们尽可能让D(X,Y)=1,
对于生成图片,让D(X,G(x))=0
判别器

Lbce表示交叉熵

生成器的训练
对于生成图片,让D(X,G(x))=1
这里写图片描述

然后通过随机梯度下降法进行训练

训练网络
生成器,映射为(m+n)*h*w->(m+n)*h*w
判别器,映射为(m+n)*h*w->[0,1]

实验结果:
数据集:UCF101

1帧和2帧预测
1帧和两帧

1帧和8帧预测
这里写图片描述

这里我们可以看到,当预测帧数较多时,SSIM不是很高,这篇论文比较早,看之后的论文有没有解决。

tensoeflow代码实现

There are several ways to perform LSTM multi-step prediction in Matlab. One possible approach is as follows: 1. Load and preprocess the data: Load the dataset and preprocess it by normalizing the data, dividing it into training and testing sets, and creating input-output pairs for the LSTM model. 2. Define the LSTM model: Create a Sequential model in Matlab and add LSTM layers with appropriate input and output sizes. You may also add other layers such as Dropout or Dense layers to improve the model's performance. 3. Train the LSTM model: Train the LSTM model on the training data using the fit function in Matlab. You can specify the number of epochs, batch size, and other training parameters. 4. Make predictions: Use the predict function in Matlab to make predictions on the test data. You can use the output from the previous time step as input for the next prediction, creating a sequence of predictions. 5. Evaluate the model: Calculate the mean squared error or other metrics to evaluate the performance of the LSTM model. Here is some sample code for LSTM multi-step prediction in Matlab: % Load and preprocess the data data = load('data.mat'); data = normalize(data); [trainData, testData] = splitData(data, 0.8); [trainX, trainY] = createInputOutputPairs(trainData, seqLength, numFeatures); [testX, testY] = createInputOutputPairs(testData, seqLength, numFeatures); % Define the LSTM model model = createLSTMModel(seqLength, numFeatures, numOutputs, numHiddenUnits); % Train the LSTM model options = trainingOptions('adam', 'MaxEpochs', numEpochs, 'MiniBatchSize', miniBatchSize); trainedModel = trainModel(model, trainX, trainY, options); % Make predictions numSteps = size(testX, 2) / numOutputs; predictions = []; for i = 1:numSteps idx = (i-1)*numOutputs+1 : i*numOutputs; if i == 1 input = testX(:, idx, :); else input = cat(2, output, testX(:, idx(end), :)); end output = predict(trainedModel, input); predictions = cat(2, predictions, output); end % Evaluate the model mse = evaluateModel(predictions, testY);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值