loop invariant

本文深入探讨了循环不变式的概念,将其分为两类:逼近postcondition的'essential'和'bounding'属性,通过解耦和常数放松等技术从postcondition中推导出循环不变式。

http://www.doc88.com/p-9661504502550.html

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

p,q都是断言 R就是循环不变式

— By their role with respect to the postcondition (Section 3.1), leading us to distinguishbetween “essential” and “bounding” invariant properties.
— By the transformation technique that yields the invariant from the postcondition (Sec-tion 3.2). Here we have techniques such as uncoupling and constant relaxation

loop invariant分类:

  1. 按role分:逼近postcondition是越来越聚集or越爱越分散靠近bounding
  2. 变量:解耦(改变变量)和常数(i=10)
Model: "sequential_3" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= sequential_2 (Sequential) (None, 96, 96, 1) 3 conv2d_3 (Conv2D) (None, 96, 96, 64) 640 dropout_3 (Dropout) (None, 96, 96, 64) 0 max_pooling2d_3 (MaxPooling (None, 48, 48, 64) 0 2D) conv2d_4 (Conv2D) (None, 48, 48, 128) 73856 dropout_4 (Dropout) (None, 48, 48, 128) 0 max_pooling2d_4 (MaxPooling (None, 24, 24, 128) 0 2D) conv2d_5 (Conv2D) (None, 24, 24, 256) 295168 dropout_5 (Dropout) (None, 24, 24, 256) 0 max_pooling2d_5 (MaxPooling (None, 12, 12, 256) 0 2D) flatten_1 (Flatten) (None, 36864) 0 dense_1 (Dense) (None, 100) 3686500 ================================================================= Total params: 4,056,167 Trainable params: 4,056,164 Non-trainable params: 3 _________________________________________________________________ Epoch 1/50 WARNING:tensorflow:Using a while_loop for converting RngReadAndSkip cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomUniformV2 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting ImageProjectiveTransformV3 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting RngReadAndSkip cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomUniformV2 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting ImageProjectiveTransformV3 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting RngReadAndSkip cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomUniformFullIntV2 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomGetKeyCounter cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomUniformV2 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting AdjustContrastv2 cause Input "contrast_factor" of op 'AdjustContrastv2' expected to be loop invariant. WARNING:tensorflow:Using a while_loop for converting RngReadAndSkip cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomUniformV2 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting ImageProjectiveTransformV3 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting RngReadAndSkip cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomUniformV2 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting ImageProjectiveTransformV3 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting RngReadAndSkip cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomUniformFullIntV2 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomGetKeyCounter cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomUniformV2 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting AdjustContrastv2 cause Input "contrast_factor" of op 'AdjustContrastv2' expected to be loop invariant. Epoch 1: val_accuracy improved from -inf to 0.00000, saving model to AR_CNN_Model.h5 50/50 - 68s - loss: 4.5637 - accuracy: 0.0100 - val_loss: 5.0749 - val_accuracy: 0.0000e+00 - lr: 1.0000e-05 - 68s/epoch - 1s/step Epoch 2/50 Epoch 2: val_accuracy did not improve from 0.00000 50/50 - 54s - loss: 4.4590 - accuracy: 0.0131 - val_loss: 5.5197 - val_accuracy: 0.0000e+00 - lr: 1.0000e-05 - 54s/epoch - 1s/step Epoch 3/50 Epoch 3: val_accuracy did not improve from 0.00000 50/50 - 52s - loss: 4.4121 - accuracy: 0.0213 - val_loss: 5.9320 - val_accuracy: 0.0000e+00 - lr: 1.0000e-05 - 52s/epoch - 1s/step Epoch 4/50 Epoch 4: val_accuracy did not improve from 0.00000 50/50 - 53s - loss: 4.3803 - accuracy: 0.0144 - val_loss: 6.2919 - val_accuracy: 0.0000e+00 - lr: 1.0000e-05 - 53s/epoch - 1s/step Epoch 5/50 Epoch 5: val_accuracy did not improve from 0.00000 50/50 - 52s - loss: 4.3625 - accuracy: 0.0269 - val_loss: 6.6495 - val_accuracy: 0.0000e+00 - lr: 1.0000e-05 - 52s/epoch - 1s/step Epoch 6/50 Epoch 6: val_accuracy did not improve from 0.00000 50/50 - 53s - loss: 4.3279 - accuracy: 0.0381 - val_loss: 7.0088 - val_accuracy: 0.0000e+00 - lr: 1.0000e-05 - 53s/epoch - 1s/step Epoch 7/50 Epoch 7: val_accuracy did not improve from 0.00000 50/50 - 38s - loss: 4.3096 - accuracy: 0.0362 - val_loss: 7.0906 - val_accuracy: 0.0000e+00 - lr: 2.0000e-06 - 38s/epoch - 755ms/step Epoch 8/50 Epoch 8: val_accuracy did not improve from 0.00000 50/50 - 28s - loss: 4.2998 - accuracy: 0.0437 - val_loss: 7.1795 - val_accuracy: 0.0000e+00 - lr: 2.0000e-06 - 28s/epoch - 567ms/step Epoch 9/50 Epoch 9: val_accuracy did not improve from 0.00000 50/50 - 29s - loss: 4.2911 - accuracy: 0.0444 - val_loss: 7.2759 - val_accuracy: 0.0000e+00 - lr: 2.0000e-06 - 29s/epoch - 577ms/step Epoch 10/50 Epoch 10: val_accuracy did not improve from 0.00000 50/50 - 29s - loss: 4.2824 - accuracy: 0.0625 - val_loss: 7.3738 - val_accuracy: 0.0000e+00 - lr: 2.0000e-06 - 29s/epoch - 578ms/step Epoch 11/50 Epoch 11: val_accuracy did not improve from 0.00000 50/50 - 28s - loss: 4.2864 - accuracy: 0.0469 - val_loss: 7.4706 - val_accuracy: 0.0000e+00 - lr: 2.0000e-06 - 28s/epoch - 551ms/step Epoch 12/50 Epoch 12: val_accuracy did not improve from 0.00000 50/50 - 29s - loss: 4.2845 - accuracy: 0.0419 - val_loss: 7.4895 - val_accuracy: 0.0000e+00 - lr: 4.0000e-07 - 29s/epoch - 572ms/step Epoch 13/50 Epoch 13: val_accuracy did not improve from 0.00000 50/50 - 28s - loss: 4.2745 - accuracy: 0.0463 - val_loss: 7.5108 - val_accuracy: 0.0000e+00 - lr: 4.0000e-07 - 28s/epoch - 563ms/step Epoch 14/50 Epoch 14: val_accuracy did not improve from 0.00000 50/50 - 28s - loss: 4.2786 - accuracy: 0.0569 - val_loss: 7.5319 - val_accuracy: 0.0000e+00 - lr: 4.0000e-07 - 28s/epoch - 554ms/step Epoch 15/50 Epoch 15: val_accuracy did not improve from 0.00000 50/50 - 28s - loss: 4.2741 - accuracy: 0.0538 - val_loss: 7.5536 - val_accuracy: 0.0000e+00 - lr: 4.0000e-07 - 28s/epoch - 557ms/step
最新发布
06-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值