{"id":439051,"date":"2021-04-12T19:47:06","date_gmt":"2021-04-12T11:47:06","guid":{"rendered":"http:\/\/4563.org\/?p=439051"},"modified":"2021-04-12T19:47:06","modified_gmt":"2021-04-12T11:47:06","slug":"%e5%a6%82%e4%bd%95%e5%b0%86%e4%bb%a5%e4%b8%8b-keras-%e7%9a%84%e7%a5%9e%e7%bb%8f%e7%bd%91%e7%bb%9c%e6%a8%a1%e5%9e%8b%e6%94%b9%e4%b8%ba-pytorch-%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=439051","title":{"rendered":"\u5982\u4f55\u5c06\u4ee5\u4e0b keras \u7684\u795e\u7ecf\u7f51\u7edc\u6a21\u578b\u6539\u4e3a pytorch \u7684\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5982\u4f55\u5c06\u4ee5\u4e0b keras \u7684\u795e\u7ecf\u7f51\u7edc\u6a21\u578b\u6539\u4e3a pytorch \u7684\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : aijiyenan <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u8fd9\u662f\u6211\u60f3\u8f6c\u6362\u4e3a pytorch \u7684\u793a\u4f8b keras \u4ee3\u7801!\u4e0b\u56fe\u4e3a\u6a21\u578b\u7ed3\u6784 https:\/\/file.nuomiphp.com\/uploads\/20210413\/FmdyObK_bDET2ChmVw44z33QaYGO.png<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b\uff1a model = Sequential() model.add(LSTM(input_dim=1, units=50, return_sequences=True)) #model.add(Dropout(0.2)) model.add(LSTM(input_dim=50, units=100, return_sequences=True)) #model.add(Dropout(0.2)) model.add(LSTM(input_dim=100, units=200, return_sequences=True)) #model.add(Dropout(0.2)) model.add(LSTM(300, return_sequences=False)) model.add(Dropout(0.2)) model.add(Dense(100)) model.add(Dense(units=1)) model.add(Activation(&#8216;relu&#8217;)) model.compile(loss=&#8217;mean_squared_error&#8217;, optimizer=&#8217;Adam&#8217;) model.summary()<\/p>\n<p>\u5e0c\u671b\u6709\u4eba\u80fd\u89e3\u7b54\u4e00\u4e0b\uff0c\u975e\u5e38\u611f\u8c22\uff01<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>6<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5753295\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : GrayXu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bd5\u8bd5 onnx \u3002\u3002\u611f\u89c9\u6a21\u578b\u4e5f\u6ca1\u6709\u5f88\u91cd\uff0c\u8981\u4e0d\u91cd\u65b0\u8bad\u4e00\u4e2a\u5457\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5753296\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mikumkf <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             from torch import nn \u7136\u540e model = nn.Sequential()\uff0c\u7136\u540e\u540e\u9762\u7684\u4e00\u81f4\u5c31\u884c\u4e86~                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5753297\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jc89898 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e48\u7b80\u5355\u7684\u7f51\u7edc\uff0c\u4f60\u624b\u5199\u4e00\u4e2a\u4e5f\u8981\u4e0d\u4e86 10 \u5206\u949f\u5427\uff0c\u800c\u4e14\u57fa\u672c\u90fd\u662f\u4e00\u6837\u7684\u4ee3\u7801\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5753298\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : aijiyenan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @GrayXu <br \/>@mikumkf <br \/>@jc89898 \u8c22\u8fc7\u5927\u4f6c\u4eec\uff0c\u73b0\u5728\u7528 pytorch \u91cd\u65b0\u5199\u4e86\u4e00\u4e2a\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5753299\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Yeen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8c01\u6709\u514d\u8d39\u7684 gpu \u670d\u52a1\u5668\u63a8\u8350\u7684\uff0c\u53ea\u9700\u8981\u8bd5\u7528\u4e00\u6bb5\u65f6\u95f4\u4e5f\u53ef\u4ee5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5753300\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xyfan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Yeen \u770b\u4f60\u60f3\u7528\u591a\u4e45\u4e86\uff0c\u7b80\u5355\u6d4b\u8bd5\u7528 Colab                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5c06\u4ee5\u4e0b keras \u7684\u795e\u7ecf\u7f51\u7edc&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/439051"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=439051"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/439051\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=439051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=439051"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=439051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}