{"id":15,"date":"2026-05-07T21:54:24","date_gmt":"2026-05-07T12:54:24","guid":{"rendered":"https:\/\/material-ai-lab.com\/?p=15"},"modified":"2026-05-07T21:55:18","modified_gmt":"2026-05-07T12:55:18","slug":"%e3%80%90%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%80%91%e5%8c%96%e5%ad%a6%e7%b3%bb%e7%a0%94%e7%a9%b6%e8%80%85%e3%81%afpytorch%e3%81%a8tensorflow%e3%81%ae%e3%81%a9%e3%81%a1%e3%82%89%e3%82%92","status":"publish","type":"post","link":"https:\/\/material-ai-lab.com\/?p=15","title":{"rendered":"\u3010\u521d\u5fc3\u8005\u5411\u3051\u3011\u5316\u5b66\u7cfb\u7814\u7a76\u8005\u306fPyTorch\u3068TensorFlow\u306e\u3069\u3061\u3089\u3092\u9078\u3076\u3079\u304d\uff1f\u9055\u3044\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u6bd4\u8f03"},"content":{"rendered":"\n<p>\u5316\u5b66\u7cfb\u306e\u7814\u7a76\u8005\u304c\u6a5f\u68b0\u5b66\u7fd2\u306e\u958b\u767a\u3092\u59cb\u3081\u308b\u3068\u304d\u3001<strong>PyTorch<\/strong>\u3068<strong>TensorFlow<\/strong>\u306e\u3069\u3061\u3089\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u9078\u3079\u3070\u3088\u3044\u304b\u8ff7\u3046\u65b9\u306f\u591a\u3044\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p>\u79c1\u81ea\u8eab\u3001PyTorch\u3068TensorFlow\u306e\u4e21\u65b9\u3092\u4f7f\u3063\u3066\u958b\u767a\u3057\u305f\u7d4c\u9a13\u304c\u3042\u308a\u307e\u3059\u3002\u7d50\u8ad6\u304b\u3089\u8a00\u3046\u3068\u3001<strong>\u3053\u308c\u304b\u3089\u59cb\u3081\u308b\u65b9\u306b\u306fPyTorch\u304c\u304a\u3059\u3059\u3081\u3067\u3059<\/strong>\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u4ee5\u4e0b\u306e3\u3064\u306e\u89b3\u70b9\u304b\u3089\u5206\u304b\u308a\u3084\u3059\u304f\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>1. \u73fe\u5728\u4e3b\u6d41\u306a\u306e\u306f\u3069\u3061\u3089\u304b<br>2. OS\u3078\u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u5bfe\u5fdc<br>3. \u5b9f\u88c5\u306e\u3057\u3084\u3059\u3055<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">1. \u73fe\u5728\u4e3b\u6d41\u306a\u306e\u306f\u3069\u3061\u3089\u304b<\/h2>\n\n\n\n<p>\u307e\u305a\u6c17\u306b\u306a\u308b\u306e\u306f\u3001\u73fe\u5728\u3069\u3061\u3089\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u4e3b\u6d41\u306a\u306e\u304b\u3068\u3044\u3046\u70b9\u3067\u3059\u3002<\/p>\n\n\n\n<p>Google\u30c8\u30ec\u30f3\u30c9\u3067PyTorch\u3068TensorFlow\u306e\u691c\u7d22\u6570\u3092\u6bd4\u8f03\u3059\u308b\u3068\u3001\u8fd1\u5e74\u306f<strong>PyTorch\u306e\u5b58\u5728\u611f\u304c\u5927\u304d\u304f\u306a\u3063\u3066\u3044\u308b<\/strong>\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002AI\u958b\u767a\u7528\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066\u306f\u3001TensorFlow\u304c\u5148\u884c\u3057\u3066\u666e\u53ca\u3057\u307e\u3057\u305f\u3002TensorFlow\u306f2015\u5e74\u306b\u30d9\u30fc\u30bf\u7248\u30012017\u5e74\u306b\u30d0\u30fc\u30b8\u30e7\u30f31.0\u3092\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u3002\u4e00\u65b9\u3001PyTorch\u306f2017\u5e74\u306b\u516c\u958b\u3055\u308c\u305f\u5f8c\u767a\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001<strong>\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u3084\u3059\u3055\u3084\u6271\u3044\u3084\u3059\u3055<\/strong>\u306e\u9762\u3067PyTorch\u304c\u8a55\u4fa1\u3055\u308c\u3001\u73fe\u5728\u3067\u306f\u7814\u7a76\u958b\u767a\u306e\u73fe\u5834\u3067\u3082\u5e83\u304f\u4f7f\u308f\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u7279\u306b\u3001\u3053\u308c\u304b\u3089\u6a5f\u68b0\u5b66\u7fd2\u3092\u5b66\u3076\u521d\u5fc3\u8005\u306b\u3068\u3063\u3066\u306f\u3001PyTorch\u306e\u307b\u3046\u304c\u7406\u89e3\u3057\u3084\u3059\u3044\u5834\u9762\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.blogger.com\/blog\/post\/edit\/7026973157148678023\/503267747402242637#\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/a\/AVvXsEhoWLlzsk3DaUKcimKL-KhTIdFKsUalcghEkFTFYtyi_Qk_6Ahy2-hGbqH14LeOyh26AxuJ_QrD92Xvq4iTl1XODXo_ntupQIlNRQim52Ll36bd10RLxq5v92MepPhgW3IyfubDSpZQRrHFTCScqlYngPJE6GvY2c66oYyKfuUlfm4VSdudR3C1lPXwhE-X=w640-h238\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">2. OS\u3078\u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u5bfe\u5fdc<\/h2>\n\n\n\n<p>\u5b66\u6821\u3084\u4f1a\u793e\u3067\u4f7f\u3063\u3066\u3044\u308b\u30d1\u30bd\u30b3\u30f3\u306eOS\u306f\u3001<strong>Windows<\/strong>\u3067\u3042\u308b\u3053\u3068\u304c\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u6a5f\u68b0\u5b66\u7fd2\u3067\u306f\u3001\u8a08\u7b97\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306b<strong>GPU<\/strong>\u3092\u4f7f\u3046\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<p>PyTorch\u306f\u3001<strong>Windows\u74b0\u5883\u3067\u3082\u30cd\u30a4\u30c6\u30a3\u30d6\u306bGPU\u3092\u30b5\u30dd\u30fc\u30c8<\/strong>\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.blogger.com\/blog\/post\/edit\/7026973157148678023\/503267747402242637#\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/a\/AVvXsEh8tSAyS77V4cZ7hdmihI_7X7RwQp9i1K26fl5N-G8W0K4rnGaOjqs7QncXyR5fJYmQC4xJTp_QoDabDtPjTEuNUyZtPZQus4EZcfsKQinlL8MS8O4krjlbYNWTcXqRzBpAoZBLDSFRoRBvS0unSyGR21AH7StGfSXpg4x-oz_ZXG7v5fYJMaRkq8NEjcXw=w640-h216\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/pytorch.org\/get-started\/locally\n<\/div><\/figure>\n\n\n\n<p>\u4e00\u65b9\u3067\u3001TensorFlow\u306f<strong>\u30d0\u30fc\u30b8\u30e7\u30f32.10\u3092\u6700\u5f8c\u306b\u3001Windows\u30cd\u30a4\u30c6\u30a3\u30d6\u74b0\u5883\u3067\u306eGPU\u30b5\u30dd\u30fc\u30c8\u3092\u7d42\u4e86<\/strong>\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.blogger.com\/blog\/post\/edit\/7026973157148678023\/503267747402242637#\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/a\/AVvXsEi5gwv1HTaZ8ivMaGEL7-AwpKoSSPcaEHzzGRu9Lw4MtyZyx4qJkJZvpJTsaa7t0fONmSWD8EKWoQ97k4AH8KVv78w1fhl22HQPLzqsikzxdXFg0UmRHoRBdsZvphtJbu8eyR7jmiTsB1LwqBcm5b2RLzAC0zXkyiTWaFMr6d6UV8WNLc1JSUJWHqYKqJpq=w640-h248\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/www.tensorflow.org\/install\/pip#windows-native\n<\/div><\/figure>\n\n\n\n<p>TensorFlow\u3067Windows\u4e0a\u306eGPU\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\u3001WSL\uff08Windows Subsystem for Linux\uff09\u3092\u5229\u7528\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u4f1a\u793e\u306e\u30d1\u30bd\u30b3\u30f3\u3067\u306f\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u90fd\u5408\u3067WSL\u306e\u5229\u7528\u304c\u5236\u9650\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3082\u5c11\u306a\u304f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u305f\u3081\u3001<strong>Windows\u74b0\u5883\u3067\u30b9\u30e0\u30fc\u30ba\u306b\u6a5f\u68b0\u5b66\u7fd2\u3092\u59cb\u3081\u305f\u3044\u65b9\u306b\u306f\u3001PyTorch\u306e\u307b\u3046\u304c\u5c0e\u5165\u3057\u3084\u3059\u3044<\/strong>\u3068\u8a00\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. \u5b9f\u88c5\u306e\u3057\u3084\u3059\u3055<\/h2>\n\n\n\n<p>\u5b9f\u88c5\u306e\u3057\u3084\u3059\u3055\u306b\u3064\u3044\u3066\u306f\u3001<strong>TensorFlow\u306e\u307b\u3046\u304c\u30b7\u30f3\u30d7\u30eb\u306b\u66f8\u3051\u308b\u5834\u9762\u304c\u3042\u308a\u307e\u3059<\/strong>\u3002\u7279\u306b\u3001TensorFlow\u306e<strong>Functional API<\/strong>\u306f\u69cb\u9020\u304c\u5206\u304b\u308a\u3084\u3059\u304f\u3001\u5c11\u306a\u3044\u30b3\u30fc\u30c9\u91cf\u3067\u30e2\u30c7\u30eb\u3092\u5b9a\u7fa9\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4e00\u65b9\u3067\u3001PyTorch\u306fTensorFlow\u306eFunctional API\u3068\u8003\u3048\u65b9\u304c\u8fd1\u304f\u3001\u8a18\u8ff0\u91cf\u306f\u3084\u3084\u591a\u3044\u3082\u306e\u306e\u3001\u66f8\u304d\u65b9\u305d\u306e\u3082\u306e\u304c\u6975\u7aef\u306b\u96e3\u3057\u3044\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u3080\u3057\u308d\u3001<strong>\u51e6\u7406\u306e\u6d41\u308c\u304c\u898b\u3048\u3084\u3059\u3044\u305f\u3081\u3001\u5b66\u7fd2\u7528\u3068\u3057\u3066\u7406\u89e3\u3057\u3084\u3059\u3044<\/strong>\u3068\u3044\u3046\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4e0b\u8a18\u306b\u3001\u540c\u7b49\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">PyTorch\u306e\u30b3\u30fc\u30c9<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>class MNISTFunctionalNet(nn.Module):\n    def __init__(self):\n        super().__init__()\n        self.fc1 = nn.Linear(28 * 28, 128)\n        self.fc2 = nn.Linear(128, 64)\n        self.fc3 = nn.Linear(64, 10)\n\n    def forward(self, x):\n        x = torch.flatten(x, start_dim=1)  # &#91;N,1,28,28] -> &#91;N,784]\n        x = F.relu(self.fc1(x))\n        x = F.relu(self.fc2(x))\n        x = self.fc3(x)  # logits\n        return x\n\nmodel = MNISTFunctionalNet().to(device)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">TensorFlow\u306e\u30b3\u30fc\u30c9<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>inputs = tf.keras.Input(shape=(28, 28, 1))\n\nx = layers.Flatten()(inputs)          # &#91;N, 28, 28, 1] -> &#91;N, 784]\nx = layers.Dense(128, activation='relu')(x)\nx = layers.Dense(64, activation='relu')(x)\noutputs = layers.Dense(10)(x)         # logits\n\nmodel = Model(inputs=inputs, outputs=outputs, name=\"MNISTFunctionalNet\")<\/code><\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u6bd4\u8f03\u3059\u308b\u3068\u3001TensorFlow\u306e\u307b\u3046\u304c\u30b3\u30f3\u30d1\u30af\u30c8\u306b\u898b\u3048\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u3053\u308c\u304b\u3089\u6a5f\u68b0\u5b66\u7fd2\u306e\u4e2d\u8eab\u3092\u7406\u89e3\u3057\u306a\u304c\u3089\u5b66\u3073\u305f\u3044\u65b9\u306b\u3068\u3063\u3066\u306f\u3001<strong>PyTorch\u306e\u660e\u793a\u7684\u306a\u66f8\u304d\u65b9\u306e\u307b\u3046\u304c\u5b66\u7fd2\u3057\u3084\u3059\u3044<\/strong>\u3068\u611f\u3058\u308b\u5834\u5408\u3082\u591a\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. \u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u3053\u308c\u304b\u3089\u6a5f\u68b0\u5b66\u7fd2\u306e\u958b\u767a\u3092\u59cb\u3081\u308b\u5316\u5b66\u7cfb\u7814\u7a76\u8005\u306b\u306f\u3001<strong>PyTorch\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059<\/strong>\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u7406\u7531\u306f\u3001\u4ee5\u4e0b\u306e2\u70b9\u304c\u5927\u304d\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30fb\u4eca\u5f8c\u3082\u5229\u7528\u8005\u304c\u591a\u3044\u3068\u8003\u3048\u3089\u308c\u308b\u3053\u3068<br>\u30fbWindows\u74b0\u5883\u3067GPU\u3092\u4f7f\u3044\u3084\u3059\u3044\u3053\u3068<\/p>\n\n\n\n<p>TensorFlow\u306b\u3082\u512a\u308c\u305f\u70b9\u306f\u3042\u308a\u307e\u3059\u304c\u3001<strong>\u521d\u5fc3\u8005\u304c\u5b66\u7fd2\u3092\u59cb\u3081\u3084\u3059\u304f\u3001\u304b\u3064Windows\u74b0\u5883\u3067\u3082\u6271\u3044\u3084\u3059\u3044<\/strong>\u3068\u3044\u3046\u610f\u5473\u3067\u3001\u73fe\u6642\u70b9\u3067\u306fPyTorch\u306e\u307b\u3046\u304c\u9078\u3073\u3084\u3059\u3044\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u304b\u3089\u65b0\u3057\u304f\u6a5f\u68b0\u5b66\u7fd2\u3092\u59cb\u3081\u308b\u65b9\u306f\u3001\u307e\u305aPyTorch\u304b\u3089\u5b66\u3093\u3067\u307f\u308b\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002\u3059\u3067\u306bTensorFlow\u3092\u4f7f\u3063\u3066\u3044\u308b\u65b9\u3082\u3001\u4eca\u5f8c\u306e\u958b\u767a\u74b0\u5883\u3084\u5b66\u7fd2\u306e\u3057\u3084\u3059\u3055\u3092\u8003\u3048\u308b\u3068\u3001PyTorch\u3078\u306e\u79fb\u884c\u3092\u691c\u8a0e\u3059\u308b\u4fa1\u5024\u306f\u5341\u5206\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5316\u5b66\u7cfb\u306e\u7814\u7a76\u8005\u304c\u6a5f\u68b0\u5b66\u7fd2\u306e\u958b\u767a\u3092\u59cb\u3081\u308b\u3068\u304d\u3001PyTorch\u3068TensorFlow\u306e\u3069\u3061\u3089\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u9078\u3079\u3070\u3088\u3044\u304b\u8ff7\u3046\u65b9\u306f\u591a\u3044\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046&#8230;<\/p>\n","protected":false},"author":1,"featured_media":19,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4,7],"tags":[],"class_list":["post-15","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-python"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/material-ai-lab.com\/index.php?rest_route=\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/material-ai-lab.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/material-ai-lab.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/material-ai-lab.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/material-ai-lab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15"}],"version-history":[{"count":4,"href":"https:\/\/material-ai-lab.com\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":21,"href":"https:\/\/material-ai-lab.com\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions\/21"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/material-ai-lab.com\/index.php?rest_route=\/wp\/v2\/media\/19"}],"wp:attachment":[{"href":"https:\/\/material-ai-lab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/material-ai-lab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/material-ai-lab.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}