
{"id":10747,"date":"2026-07-23T18:03:38","date_gmt":"2026-07-23T09:03:38","guid":{"rendered":"https:\/\/techmania.jp\/blog\/?p=10747"},"modified":"2026-07-23T18:03:40","modified_gmt":"2026-07-23T09:03:40","slug":"pytorch","status":"publish","type":"post","link":"https:\/\/techmania.jp\/blog\/pytorch\/","title":{"rendered":"PyTorch\u3068\u306f\uff1f\u7279\u5fb4\u3084\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u3001\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u89e3\u8aac"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6700\u8fd1\u3001\u79c1\u306e\u8077\u5834\u3067\u306f<span class=\"c-user01\" style=\"font-weight:bold;\">\u300cPyTorch\u3063\u3066\u7d50\u5c40TensorFlow\u3068\u4f55\u304c\u9055\u3046\u306e?\u300d<\/span>\u3068\u805e\u304b\u308c\u308b\u3053\u3068\u304c\u5897\u3048\u3066\u304d\u307e\u3057\u305f\u3002<br>AI\u306e\u958b\u767a\u3067\u306f\u3001\u753b\u50cf\u3084\u6587\u7ae0\u306a\u3069\u306e\u5927\u91cf\u30c7\u30fc\u30bf\u3092\u3082\u3068\u306b\u3001\u6570\u767e\u4e07\u301c\u6570\u5341\u5104\u500b\u3082\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6271\u3046\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002\u3053\u308c\u3092\u4e00\u304b\u3089\u81ea\u524d\u306e\u30b3\u30fc\u30c9\u3060\u3051\u3067\u7d44\u3082\u3046\u3068\u3059\u308b\u3068\u81a8\u5927\u306a\u624b\u9593\u304c\u304b\u304b\u308b\u305f\u3081\u3001\u3053\u3046\u3057\u305f\u8a08\u7b97\u3092\u52b9\u7387\u3088\u304f\u884c\u3048\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002<br>\u305d\u306e\u4e2d\u3067\u3082\u3001<a href=\"https:\/\/ai.meta.com\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Meta\u793e<\/a>\u304c\u4e2d\u5fc3\u3068\u306a\u3063\u3066\u958b\u767a\u3057\u305f\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u6a5f\u68b0\u5b66\u7fd2\u30e9\u30a4\u30d6\u30e9\u30ea\u304c<a href=\"https:\/\/pytorch.org\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u300cPyTorch\u300d<\/a> \u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u8a18\u4e8b\u3067\u306f\u3001<span class=\"c-user01\" style=\"font-weight:bold;\">PyTorch<\/span>\u306e\u6982\u8981\u3084\u7279\u5fb4\u3001\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3001TensorFlow\uff08Google\u793e\uff09\u3068\u306e\u9055\u3044\u3001\u958b\u767a\u52b9\u7387\u3092\u3055\u3089\u306b\u9ad8\u3081\u3066\u304f\u308c\u308b<span class=\"c-user01\" style=\"font-weight:bold;\">PyTorch Lightning<\/span>\u306a\u3069\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__1\" class=\"wp-block-heading\">PyTorch\u3068\u306f<\/h2>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/images\/techmania\/thumbnail\/images\/PyTorch_Top.webp\" class=\"post-img\" alt=\"PyTorch Top\u753b\u9762\" loading=\"lazy\"><\/p>\n<p style=\"font-size: 13px; color: #666; text-align: center; margin-top: 8px;\">\n  \u51fa\u5178:<a href=\"https:\/\/pytorch.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">PyTorch<\/a><\/p>\n\n\n\n<h3 id=\"outline__1_1\" class=\"wp-block-heading\">AI\u30fb\u6a5f\u68b0\u5b66\u7fd2\u3092\u652f\u3048\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u6982\u8981<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch\u306f\u3001<a href=\"https:\/\/techmania.jp\/blog\/python0001\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Python<\/a>\u3067\u5229\u7528\u53ef\u80fd\u306a\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<br>2016\u5e741\u6708\u306bMeta\u793e\uff08\u65e7Facebook\uff09\u306eAI \u7814\u7a76\u30b0\u30eb\u30fc\u30d7\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u3001\u73fe\u5728\u306f\u4e16\u754c\u4e2d\u306e\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3084\u4f01\u696d\u306b\u3088\u3063\u3066\u7d99\u7d9a\u7684\u306b\u958b\u767a\u304c\u9032\u3081\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u3067\u306f\u3001\u753b\u50cf\u3084\u6587\u7ae0\u3001\u97f3\u58f0\u306a\u3069\u306e\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u7528\u3044\u3066\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u5b66\u7fd2\u3055\u305b\u307e\u3059\u3002<br>\u3057\u304b\u3057\u3001\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u5b66\u7fd2\u3067\u306f\u6570\u767e\u4e07\u301c\u6570\u5341\u5104\u500b\u3082\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u5bfe\u3059\u308b\u884c\u5217\u6f14\u7b97\u3092\u9ad8\u901f\u306b\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u901a\u5e38\u306e<a href=\"https:\/\/techmania.jp\/blog\/python0001\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Python<\/a>\u3060\u3051\u3067\u306f\u73fe\u5b9f\u7684\u306a\u901f\u5ea6\u3067\u51e6\u7406\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002<br>PyTorch\u306f\u3001\u3053\u3046\u3057\u305f\u8a08\u7b97\u3092<span class=\"c-user01\" style=\"font-weight:bold;\">GPU\u4e0a\u3067\u9ad8\u901f\u306b\u5b9f\u884c\u3067\u304d\u308b\u4ed5\u7d44\u307f<\/span>\u3092\u5099\u3048\u3066\u304a\u308a\u3001\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u69cb\u7bc9\u30fb\u5b66\u7fd2\u30fb\u63a8\u8ad6\u307e\u3067\u3092\u7d71\u4e00\u7684\u306b\u884c\u3048\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305f\u3001PyTorch\u306f\u5358\u306a\u308b\u6570\u5024\u8a08\u7b97\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u306f\u306a\u304f\u3001\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u30ec\u30a4\u30e4\u30fc\u3084\u640d\u5931\u95a2\u6570\u3001\u6700\u9069\u5316\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3001\u30c7\u30fc\u30bf\u8aad\u307f\u8fbc\u307f\u6a5f\u80fd\u306a\u3069\u3001AI\u958b\u767a\u306b\u5fc5\u8981\u306a\u6a5f\u80fd\u304c\u5305\u62ec\u7684\u306b\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br>\u753b\u50cf\u8a8d\u8b58\u3084\u81ea\u7136\u8a00\u8a9e\u51e6\u7406\u3001\u97f3\u58f0\u8a8d\u8b58\u3001\u751f\u6210AI\u306a\u3069\u3001\u591a\u69d8\u306aAI\u958b\u767a\u3067\u5229\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eca\u3067\u306f\u3001<a href=\"https:\/\/techmania.jp\/blog\/hugging-face\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Hugging Face Transformers<\/a>\u3084PyTorch Lightning\u306a\u3069\u3001\u591a\u304f\u306eAI\u30e9\u30a4\u30d6\u30e9\u30ea\u3082PyTorch\u3092\u30d9\u30fc\u30b9\u3068\u3057\u3066\u69cb\u7bc9\u3055\u308c\u3066\u304a\u308a\u3001AI\u30a8\u30b3\u30b7\u30b9\u30c6\u30e0\u306e\u4e2d\u5fc3\u7684\u5b58\u5728\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 id=\"outline__1_2\" class=\"wp-block-heading\">\u958b\u767a\u3055\u308c\u305f\u80cc\u666f\u3068\u7814\u7a76\u30fb\u5b9f\u52d9\u3067\u9078\u3070\u308c\u308b\u7406\u7531<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch\u304c\u767b\u5834\u3059\u308b\u4ee5\u524d\u306e\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u958b\u767a\u3067\u306f\u3001<a href=\"https:\/\/www.tensorflow.org\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">TensorFlow<\/a>\u306a\u3069\u304c\u5e83\u304f\u5229\u7528\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<br>\u3057\u304b\u3057\u306a\u304c\u3089\u3001\u521d\u671f\u306eTensorFlow\u306f\u300c<code>Define-and-Run<\/code>\u300d \u3068\u547c\u3070\u308c\u308b\u8a2d\u8a08\u624b\u6cd5\u3092\u63a1\u7528\u3057\u3066\u304a\u308a\u3001\u8a08\u7b97\u30b0\u30e9\u30d5\u3092\u5168\u3066\u69cb\u7bc9\u3057\u3066\u304b\u3089\u30c7\u30fc\u30bf\u3092\u6d41\u3059\u4ed5\u69d8\u4e0a\u3001\u30c7\u30d0\u30c3\u30b0\u306e\u3057\u3065\u3089\u3055\u3084\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3059\u3050\u5b9f\u884c\u3067\u304d\u306a\u3044\u3068\u3044\u3046\u6271\u3044\u306b\u304f\u3055\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65b9\u3001PyTorch\u306f\u300c<code>Define-by-Run<\/code>\u300d\u3068\u547c\u3070\u308c\u308b\u8a2d\u8a08\u624b\u6cd5\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3059\u3002<br><code>Define-and-Run<\/code>\u3068\u306f\u53cd\u5bfe\u306b\u3001\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u306a\u304c\u3089\u8a08\u7b97\u30b0\u30e9\u30d5\u3092<span class=\"c-user01\" style=\"font-weight:bold;\">\u52d5\u7684\u306b\u69cb\u7bc9\u3059\u308b<\/span>\u65b9\u5f0f\u306e\u3053\u3068\u3092\u8a00\u3044\u3001\u901a\u5e38\u306ePython\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u611f\u899a\u3067\u30e2\u30c7\u30eb\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u4ed5\u7d44\u307f\u306b\u3088\u308a\u3001\u9014\u4e2d\u3067\u6761\u4ef6\u5206\u5c90\u3084\u30eb\u30fc\u30d7\u3092\u542b\u3080\u3088\u3046\u306a\u8907\u96d1\u306a\u30e2\u30c7\u30eb\u3067\u3082\u81ea\u7136\u306b\u8a18\u8ff0\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u30c7\u30d0\u30c3\u30b0\u3082\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3057\u305f\u3002<br>\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u969b\u306b\u306f\u901a\u5e38\u306ePython\u3068\u540c\u3058\u3088\u3046\u306b\u539f\u56e0\u3092\u8ffd\u8de1\u3067\u304d\u308b\u305f\u3081\u3001\u7814\u7a76\u958b\u767a\u306e\u30b9\u30d4\u30fc\u30c9\u304c\u5927\u304d\u304f\u5411\u4e0a\u3057\u307e\u3059\u3002<br>\u3053\u3046\u3057\u305f\u67d4\u8edf\u6027\u304b\u3089\u3001\u591a\u304f\u306e\u5927\u5b66\u3084\u7814\u7a76\u6a5f\u95a2\u3067\u306fPyTorch\u304c\u6a19\u6e96\u7684\u306a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u306a\u308a\u3001\u65b0\u3057\u3044AI\u30e2\u30c7\u30eb\u306e\u8ad6\u6587\u5b9f\u88c5\u3082PyTorch\u3067\u516c\u958b\u3055\u308c\u308b\u30b1\u30fc\u30b9\u304c\u5897\u3048\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3055\u3089\u306b\u8fd1\u5e74\u3067\u306f\u3001\u7814\u7a76\u7528\u9014\u3060\u3051\u3067\u306a\u304f\u5546\u7528\u958b\u767a\u3067\u3082\u63a1\u7528\u304c\u9032\u3093\u3067\u3044\u307e\u3059\u3002<br><a href=\"https:\/\/docs.pytorch.org\/docs\/stable\/jit.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">TorchScript<\/a>\u3084<a href=\"https:\/\/docs.pytorch.org\/serve\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">TorchServe<\/a>\u3001<a href=\"https:\/\/onnx.ai\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">ONNX<\/a>\u3068\u306e\u9023\u643a\u306a\u3069\u3001\u672c\u756a\u74b0\u5883\u3078\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u304c\u5145\u5b9f\u3057\u3001\u5927\u898f\u6a21\u30b5\u30fc\u30d3\u30b9\u306b\u3082\u5bfe\u5fdc\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u73fe\u5728\u3067\u306fOpenAI\u3084Meta\u3001Microsoft\u3001NVIDIA\u306a\u3069\u591a\u304f\u306e\u4f01\u696d\u304cPyTorch\u3092\u4e2d\u5fc3\u306bAI\u958b\u767a\u3092\u9032\u3081\u3066\u304a\u308a\u3001\u5b9f\u52d9\u306e\u73fe\u5834\u3067\u3082<span class=\"c-user01\" style=\"font-weight:bold;\">PyTorch\u306e\u6848\u4ef6\u3092\u76ee\u306b\u3059\u308b\u6a5f\u4f1a\u304c\u660e\u3089\u304b\u306b\u5897\u3048\u3066\u304d\u305f<\/span>\u5370\u8c61\u3067\u3059\u3002<\/p>\n\n\n\n<h3 id=\"outline__1_3\" class=\"wp-block-heading\">TensorFlow\u30fbKeras\u306a\u3069\u4ed6\u306e\u4e3b\u8981\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u306e\u9055\u3044<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch\u3068\u6bd4\u8f03\u3055\u308c\u308b\u4ee3\u8868\u7684\u306a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u3057\u3066\u3001TensorFlow\u3068<a href=\"https:\/\/keras.io\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Keras<\/a>\u304c\u3042\u308a\u307e\u3059\u3002<br>(Keras\u306f\u6b63\u78ba\u306b\u306f\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u306f\u306a\u304f\u3001TensorFlow\u306a\u3069\u306e\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u4e0a\u3067\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u9ad8\u6c34\u6e96API\u3067\u3059)<\/p>\n\n\n\n<div class=\"cloud-compare-table-wrap\">\n<style>\n.cloud-compare-table-wrap {\n  font-family: -apple-system, \"Hiragino Kaku Gothic ProN\", \"Yu Gothic\", sans-serif;\n  overflow-x: auto;\n  padding: 8px 0;\n}\n.cloud-compare-table {\n  border-collapse: collapse;\n  width: 100%;\n  min-width: 720px;\n  background: #fff;\n}\n.cloud-compare-table th,\n.cloud-compare-table td {\n  border: 1px solid #e2e8f0;\n  padding: 14px 18px;\n  text-align: left;\n  font-size: 14.5px;\n  line-height: 1.7;\n  color: #1f2937;\n}\n.cloud-compare-table thead th {\n  font-weight: 700;\n  font-size: 15px;\n  text-align: center;\n}\n.cloud-compare-table tbody th {\n  font-weight: 700;\n  white-space: nowrap;\n}\n<\/style>\n<table class=\"cloud-compare-table\">\n  <thead>\n    <tr>\n      <th>\u6bd4\u8f03\u9805\u76ee<\/th>\n      <th>PyTorch<\/th>\n      <th>TensorFlow<\/th>\n      <th>Keras<\/th>\n    <\/tr>\n  <\/thead>\n  <tbody>\n    <tr>\n      <th>\u958b\u767a\u5143<\/th>\n      <td>Meta<\/td>\n      <td>Google<\/td>\n      <td>Keras Team\uff08\u73fe\u5728\u306fTensorFlow\u306b\u7d71\u5408\uff09<\/td>\n    <\/tr>\n    <tr>\n      <th>\u6982\u8981<\/th>\n      <td>Python\u3089\u3057\u3044\u8a18\u8ff0\u3067\u67d4\u8edf\u306b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u3092\u5b9f\u88c5\u3067\u304d\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30e9\u30a4\u30d6\u30e9\u30ea<\/td>\n      <td>Google\u304c\u958b\u767a\u3059\u308b\u6a5f\u68b0\u5b66\u7fd2\u30fb\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af<\/td>\n      <td>TensorFlow\u306a\u3069\u306e\u4e0a\u3067\u52d5\u4f5c\u3059\u308b\u9ad8\u6c34\u6e96API<\/td>\n    <\/tr>\n    <tr>\n      <th>\u4e3b\u306a\u7528\u9014\u30fb\u5f79\u5272<\/th>\n      <td>\u7814\u7a76\u958b\u767a\u3001\u751f\u6210AI\u3001\u753b\u50cf\u8a8d\u8b58\u3001\u81ea\u7136\u8a00\u8a9e\u51e6\u7406<\/td>\n      <td>\u5546\u7528AI\u30b7\u30b9\u30c6\u30e0\u3001\u30af\u30e9\u30a6\u30c9AI\u3001\u30e2\u30d0\u30a4\u30eb\u30fb\u7d44\u307f\u8fbc\u307fAI<\/td>\n      <td>\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u7c21\u6f54\u306b\u69cb\u7bc9\u30fb\u5b66\u7fd2\u3059\u308b<\/td>\n    <\/tr>\n    <tr>\n      <th>\u7279\u5fb4<\/th>\n      <td>\u52d5\u7684\u8a08\u7b97\u30b0\u30e9\u30d5\u3092\u63a1\u7528\u3057\u3001\u30c7\u30d0\u30c3\u30b0\u3057\u3084\u3059\u3044<\/td>\n      <td>\u672c\u756a\u904b\u7528\u5411\u3051\u6a5f\u80fd\u3084\u5468\u8fba\u30c4\u30fc\u30eb\u304c\u8c4a\u5bcc<\/td>\n      <td>\u5c11\u306a\u3044\u30b3\u30fc\u30c9\u91cf\u3067\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3067\u304d\u308b<\/td>\n    <\/tr>\n    <tr>\n      <th>\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u3084\u3059\u3055<\/th>\n      <td>Python\u3089\u3057\u304f\u81ea\u7531\u5ea6\u304c\u9ad8\u3044<\/td>\n      <td>\u3084\u3084\u8907\u96d1\u3060\u304c\u67d4\u8edf<\/td>\n      <td>\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u3067\u521d\u5fc3\u8005\u5411\u3051<\/td>\n    <\/tr>\n    <tr>\n      <th>\u7814\u7a76\u7528\u9014<\/th>\n      <td>\u25ce \u975e\u5e38\u306b\u591a\u3044<\/td>\n      <td>\u25cb \u591a\u3044<\/td>\n      <td>\u25b3 \u5358\u4f53\u3067\u4f7f\u308f\u308c\u308b\u3053\u3068\u306f\u5c11\u306a\u3044<\/td>\n    <\/tr>\n    <tr>\n      <th>\u5546\u7528\u5229\u7528<\/th>\n      <td>\u25ce \u975e\u5e38\u306b\u591a\u3044<\/td>\n      <td>\u25ce \u975e\u5e38\u306b\u591a\u3044<\/td>\n      <td>\u25cb TensorFlow\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u5229\u7528<\/td>\n    <\/tr>\n    <tr>\n      <th>\u304a\u3059\u3059\u3081\u306a\u4eba<\/th>\n      <td>\u6700\u65b0AI\u3084\u751f\u6210AI\u3092\u5b66\u3073\u305f\u3044\u4eba<\/td>\n      <td>\u672c\u756a\u904b\u7528\u3084Google\u88fd\u30b5\u30fc\u30d3\u30b9\u3068\u306e\u9023\u643a\u3092\u91cd\u8996\u3059\u308b\u4eba<\/td>\n      <td>AI\u958b\u767a\u3092\u521d\u3081\u3066\u5b66\u3076\u4eba<\/td>\n    <\/tr>\n  <\/tbody>\n<\/table>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch\u306f\u3001\u67d4\u8edf\u306a\u5b9f\u88c5\u3068<span class=\"c-user01\" style=\"font-weight:bold;\">\u30c7\u30d0\u30c3\u30b0\u306e\u3057\u3084\u3059\u3055<\/span>\u304b\u3089\u3001\u7814\u7a76\u958b\u767a\u3084\u751f\u6210AI\u306e\u5206\u91ce\u3067\u7279\u306b\u9ad8\u3044\u652f\u6301\u3092\u96c6\u3081\u3066\u3044\u307e\u3059\u3002<br>\u65b0\u3057\u3044\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u7814\u7a76\u3084\u8907\u96d1\u306a\u30e2\u30c7\u30eb\u958b\u767a\u3067\u306fPyTorch\u304c\u9078\u3070\u308c\u308b\u3053\u3068\u304c\u591a\u304f\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65b9\u3001TensorFlow\u306fGoogle\u304c\u63d0\u4f9b\u3059\u308b\u6a5f\u68b0\u5b66\u7fd2\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3001\u672c\u756a\u74b0\u5883\u3078\u306e\u5c55\u958b\u3084\u5468\u8fba\u30c4\u30fc\u30eb\u3068\u306e\u9023\u643a\u306b\u5f37\u307f\u304c\u3042\u308a\u307e\u3059\u3002<br>\u307e\u305f\u3001\u73fe\u5728\u306fEager Execution\u304c\u6a19\u6e96\u3068\u306a\u308a\u3001\u4ee5\u524d\u3088\u308aPyTorch\u306b\u8fd1\u3044\u66f8\u304d\u65b9\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Keras\u306f\u3001TensorFlow\u4e0a\u3067\u52d5\u4f5c\u3059\u308b\u9ad8\u6c34\u6e96API\u3067\u3042\u308a\u3001\u5c11\u306a\u3044\u30b3\u30fc\u30c9\u91cf\u3067\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u69cb\u7bc9\u3067\u304d\u308b\u305f\u3081\u3001\u521d\u5fc3\u8005\u3067\u3082\u6271\u3044\u3084\u3059\u3044\u70b9\u304c\u7279\u5fb4\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u308c\u305e\u308c\u306e\u6a5f\u80fd\u9762\u306e\u5dee\u306f\u4ee5\u524d\u307b\u3069\u5927\u304d\u304f\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u7814\u7a76\u3084\u751f\u6210AI\u3067\u306fPyTorch\u3001Google\u88fd\u30b5\u30fc\u30d3\u30b9\u3068\u306e\u7d71\u5408\u3067\u306fTensorFlow\u3068\u3044\u3046\u50be\u5411\u304c\u4f9d\u7136\u3068\u3057\u3066\u898b\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__2\" class=\"wp-block-heading\">Pytorch\u3092\u5c0e\u5165\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u30fb\u30c7\u30e1\u30ea\u30c3\u30c8<\/h2>\n\n\n\n<h3 id=\"outline__2_1\" class=\"wp-block-heading\">\u958b\u767a\u52b9\u7387\u3084\u67d4\u8edf\u6027\u3092\u9ad8\u3081\u308b\u30e1\u30ea\u30c3\u30c8<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch\u3092\u4f7f\u7528\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u306f\u3001\u4e3b\u306b\u6b21\u306e\u901a\u308a\u3067\u3059\u3002\u7279\u306b\u3001\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u306a\u304c\u3089\u52d5\u4f5c\u3092\u78ba\u8a8d\u3067\u304d\u308b\u67d4\u8edf\u6027\u306e\u9ad8\u3055\u306f\u3001\u4ed6\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u306f\u306a\u3044\u5927\u304d\u306a\u5f37\u307f\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python\u3089\u3057\u3044\u8a18\u8ff0\u3067\u76f4\u611f\u7684\u306b\u5b9f\u88c5\u3067\u304d\u308b<\/li>\n\n\n\n<li>\u52d5\u7684\u8a08\u7b97\u30b0\u30e9\u30d5\u306b\u3088\u308a<span class=\"c-user01\" style=\"font-weight:bold;\">\u67d4\u8edf\u306a\u30e2\u30c7\u30eb\u3092\u69cb\u7bc9\u3057\u3084\u3059\u3044<\/span><\/li>\n\n\n\n<li><span class=\"c-user01\" style=\"font-weight:bold;\">\u30c7\u30d0\u30c3\u30b0\u3057\u3084\u3059\u304f\u958b\u767a\u52b9\u7387\u304c\u9ad8\u3044<\/span><\/li>\n\n\n\n<li>GPU\u3092\u6d3b\u7528\u3057\u305f\u9ad8\u901f\u306a\u5b66\u7fd2\u30fb\u63a8\u8ad6\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b<\/li>\n\n\n\n<li>\u751f\u6210AI\u3092\u542b\u3080\u8c4a\u5bcc\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u30fb\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u304c\u5145\u5b9f\u3057\u3066\u3044\u308b<\/li>\n<\/ul>\n\n\n\n<h3 id=\"outline__2_2\" class=\"wp-block-heading\">\u5229\u7528\u3059\u308b\u969b\u306e\u30c7\u30e1\u30ea\u30c3\u30c8\u3068\u6ce8\u610f\u70b9<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65b9\u3067\u3001\u6b21\u306e\u3088\u3046\u306a\u30c7\u30e1\u30ea\u30c3\u30c8\u3082\u62bc\u3055\u3048\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3044\u305a\u308c\u3082\u81f4\u547d\u7684\u306a\u5f31\u70b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u5c0e\u5165\u524d\u306b\u628a\u63e1\u3057\u3066\u304a\u304f\u3068\u5b89\u5fc3\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6a5f\u68b0\u5b66\u7fd2\u3084\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306e\u57fa\u790e\u77e5\u8b58\u304c\u6c42\u3081\u3089\u308c\u308b<\/li>\n\n\n\n<li>GPU\u74b0\u5883\u3067\u306f<a href=\"https:\/\/docs.nvidia.com\/cuda\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">CUDA<\/a>\u306a\u3069\u306e<span class=\"c-user01\" style=\"font-weight:bold;\">\u74b0\u5883\u69cb\u7bc9\u304c\u3084\u3084\u8907\u96d1<\/span><\/li>\n\n\n\n<li>\u5927\u898f\u6a21\u30e2\u30c7\u30eb\u3067\u306f<span class=\"c-user01\" style=\"font-weight:bold;\">GPU\u30e1\u30e2\u30ea\u3092\u591a\u304f\u6d88\u8cbb<\/span>\u3059\u308b<\/li>\n\n\n\n<li>\u5c0f\u898f\u6a21\u306a\u7528\u9014\u3067\u306f\u6a5f\u80fd\u3092\u6301\u3066\u4f59\u3059\u5834\u5408\u304c\u3042\u308b<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch\u306f\u67d4\u8edf\u306a\u8a2d\u8a08\u3092\u53ef\u80fd\u306b\u3059\u308b\u53cd\u9762\u3001\u7d30\u304b\u3044\u51e6\u7406\u3092\u81ea\u524d\u3067\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br>\u6a5f\u68b0\u5b66\u7fd2\u3084\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306e\u77e5\u8b58\u304c\u3042\u308b\u7a0b\u5ea6\u5fc5\u8981\u306b\u306a\u308b\u305f\u3081\u3001\u5b66\u7fd2\u30b3\u30b9\u30c8\u306f\u9ad8\u3081\u306a\u50be\u5411\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__3\" class=\"wp-block-heading\">PyTorch\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u3068\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/h2>\n\n\n\n<h3 id=\"outline__3_1\" class=\"wp-block-heading\">\u74b0\u5883\u306b\u5fdc\u3058\u305f\u5c0e\u5165\u306e\u624b\u9806<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u969b\u306f\u3001\u516c\u5f0f\u30b5\u30a4\u30c8\u306e\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306a\u3069\u306b\u3042\u308b\u4ee5\u4e0b\u306e\u6b04\u3067OS\u3084Python\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3001CUDA\u306e\u6709\u7121\u3092\u9078\u629e\u3059\u308b\u3068\u3001\u6700\u9069\u306a\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30b3\u30de\u30f3\u30c9\u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/images\/techmania\/thumbnail\/images\/Install_Script.webp\" class=\"post-img\" alt=\"PyTorch \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30b3\u30de\u30f3\u30c9\" loading=\"lazy\"><\/p>\n<p style=\"font-size: 13px; color: #666; text-align: center; margin-top: 8px;\">\n  \u51fa\u5178:<a href=\"https:\/\/pytorch.org\/get-started\/locally\/\" target=\"_blank\" rel=\"noopener noreferrer\">Get Started<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">CPU\u306e\u307f\u3067\u5229\u7528\u3059\u308b\u5834\u5408\u306f\u3001pip\u3092\u7528\u3044\u3066\u7c21\u5358\u306b\u5c0e\u5165\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(14px, .875rem, 21px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#304047;color:#d5ffff\">Bash<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>pip install torch torchvision<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki material-theme\" style=\"background-color: #263238\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">pip<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">install<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">torch<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">torchvision<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86\u5f8c\u306f\u3001\u300c<code>torch.<strong>version<\/strong><\/code>\u300d \u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/images\/techmania\/thumbnail\/images\/Torch_Version.webp\" class=\"post-img\" alt=\"PyTorch \u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d\" loading=\"lazy\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">GPU\u304c\u5229\u7528\u53ef\u80fd\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u300c<code>torch.cuda.is_available()<\/code>\u300d \u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<br>mac\u74b0\u5883\u306e\u5834\u5408\u306fCUDA\u304c\u4f7f\u7528\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u4ee3\u308f\u308a\u306b \u300c<code>torch.backends.mps.is_available()<\/code>\u300d (<code>MPS<\/code>) \u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/images\/techmania\/thumbnail\/images\/Torch_GPU.webp\" class=\"post-img\" alt=\"GPU\u5229\u7528\u53ef\u5426\u78ba\u8a8d\" loading=\"lazy\"><\/p>\n\n\n\n<h3 id=\"outline__3_2\" class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u3092\u6271\u3046\u57fa\u672c\u64cd\u4f5c\u3068\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch\u3067\u306f\u300cTensor\uff08\u30c6\u30f3\u30bd\u30eb\uff09\u300d\u3068\u3044\u3046\u591a\u6b21\u5143\u914d\u5217\u304c\u57fa\u672c\u30c7\u30fc\u30bf\u69cb\u9020\u3068\u306a\u308a\u307e\u3059\u3002<br>NumPy\u914d\u5217\u306b\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001GPU\u4e0a\u3067\u9ad8\u901f\u306b\u8a08\u7b97\u3067\u304d\u3001\u81ea\u52d5\u5fae\u5206\u306b\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u306e\u304c\u7279\u5fb4\u3067\u3059\u3002<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/images\/techmania\/thumbnail\/images\/code_sample_top.webp\" class=\"post-img\" alt=\"Top\u753b\u9762\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\" loading=\"lazy\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u521d\u671f\u5316\u65b9\u6cd5\u306f\u69d8\u3005\u3042\u308a\u3001\u30c7\u30fc\u30bf\u304b\u3089\u76f4\u63a5\u4f5c\u6210\u3067\u304d\u308b\u4ed6\u3001NumPy\u914d\u5217\u304b\u3089\u4f5c\u6210\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br>\u4f5c\u6210\u6642\u306e\u30c7\u30fc\u30bf\u578b\u306f\u81ea\u52d5\u7684\u306b\u63a8\u8ad6\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(14px, .875rem, 21px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#304047;color:#d5ffff\">Python<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>import torch\nimport numpy as np\n\nx_data = &#91;1, 2, 3&#93;\nx_tensor = torch.tensor(x_data)\n\ny_data = np.array(&#91;4, 5, 6&#93;)\ny_tensor = torch.tensor(y_data)\n\nprint(x_tensor, y_tensor)<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki material-theme\" style=\"background-color: #263238\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #89DDFF; font-style: italic\">import<\/span><span style=\"color: #EEFFFF\"> torch<\/span><\/span>\n<span class=\"line\"><span style=\"color: #89DDFF; font-style: italic\">import<\/span><span style=\"color: #EEFFFF\"> numpy <\/span><span style=\"color: #89DDFF; font-style: italic\">as<\/span><span style=\"color: #EEFFFF\"> np<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">x_data <\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">&#91;<\/span><span style=\"color: #F78C6C\">1<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #F78C6C\">2<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #F78C6C\">3<\/span><span style=\"color: #89DDFF\">&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">x_tensor <\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #EEFFFF\"> torch<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">tensor<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #82AAFF\">x_data<\/span><span style=\"color: #89DDFF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">y_data <\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #EEFFFF\"> np<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">array<\/span><span style=\"color: #89DDFF\">(&#91;<\/span><span style=\"color: #F78C6C\">4<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #82AAFF\"> <\/span><span style=\"color: #F78C6C\">5<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #82AAFF\"> <\/span><span style=\"color: #F78C6C\">6<\/span><span style=\"color: #89DDFF\">&#93;)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">y_tensor <\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #EEFFFF\"> torch<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">tensor<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #82AAFF\">y_data<\/span><span style=\"color: #89DDFF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #82AAFF\">print<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #82AAFF\">x_tensor<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #82AAFF\"> y_tensor<\/span><span style=\"color: #89DDFF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(14px, .875rem, 21px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#304047;color:#d5ffff\">\u5b9f\u884c\u7d50\u679c<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>tensor(&#91;1, 2, 3&#93;) tensor(&#91;4, 5, 6&#93;)<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki material-theme\" style=\"background-color: #263238\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EEFFFF\">tensor(&#91;1, 2, 3&#93;) tensor(&#91;4, 5, 6&#93;)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305f\u3001PyTorch\u306b\u306f\u3001\u6a5f\u68b0\u5b66\u7fd2\u306b\u5fc5\u8981\u306a\u51e6\u7406\u3092\u5b9f\u88c5\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u304c\u8907\u6570\u63c3\u3063\u3066\u3044\u307e\u3059\u3002<br>\u4f8b\u3048\u3070\u3001\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u69cb\u7bc9\u3059\u308b\u969b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001<code>torch.nn<\/code>\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(14px, .875rem, 21px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#304047;color:#d5ffff\">Python<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>import torch.nn as nn\n\nmodel = nn.Sequential(\nnn.Linear(10, 20),\nnn.ReLU(),\nnn.Linear(20, 1)\n)\n\nprint(model)<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki material-theme\" style=\"background-color: #263238\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #89DDFF; font-style: italic\">import<\/span><span style=\"color: #EEFFFF\"> torch<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #F07178\">nn<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF; font-style: italic\">as<\/span><span style=\"color: #EEFFFF\"> nn<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">model <\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #EEFFFF\"> nn<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">Sequential<\/span><span style=\"color: #89DDFF\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #82AAFF\">nn<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">Linear<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #F78C6C\">10<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #82AAFF\"> <\/span><span style=\"color: #F78C6C\">20<\/span><span style=\"color: #89DDFF\">),<\/span><\/span>\n<span class=\"line\"><span style=\"color: #82AAFF\">nn<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">ReLU<\/span><span style=\"color: #89DDFF\">(),<\/span><\/span>\n<span class=\"line\"><span style=\"color: #82AAFF\">nn<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">Linear<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #F78C6C\">20<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #82AAFF\"> <\/span><span style=\"color: #F78C6C\">1<\/span><span style=\"color: #89DDFF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #89DDFF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #82AAFF\">print<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #82AAFF\">model<\/span><span style=\"color: #89DDFF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(14px, .875rem, 21px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#304047;color:#d5ffff\">\u5b9f\u884c\u7d50\u679c<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Sequential(\n(0): Linear(in_features=10, out_features=20, bias=True)\n(1): ReLU()\n(2): Linear(in_features=20, out_features=1, bias=True)\n)<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki material-theme\" style=\"background-color: #263238\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EEFFFF\">Sequential(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">(0): Linear(in_features=10, out_features=20, bias=True)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">(1): ReLU()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">(2): Linear(in_features=20, out_features=1, bias=True)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u9023\u306e\u51e6\u7406\u3092\u6bd4\u8f03\u7684\u30b7\u30f3\u30d7\u30eb\u306a\u30b3\u30fc\u30c9\u3067\u8a18\u8ff0\u3067\u304d\u3001\u5b66\u7fd2\u904e\u7a0b\u3092\u7d30\u304b\u304f\u5236\u5fa1\u3067\u304d\u308b\u70b9\u304cPyTorch\u306e\u7279\u5fb4\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8a73\u3057\u3044\u57fa\u672c\u64cd\u4f5c\u306b\u3064\u3044\u3066\u306f\u3001\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306a\u3069\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/images\/techmania\/thumbnail\/images\/PyTorch_Tutorial.webp\" class=\"post-img\" alt=\"PyTorch\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" loading=\"lazy\"><\/p>\n<p style=\"font-size: 13px; color: #666; text-align: center; margin-top: 8px;\">\u51fa\u5178:<a href=\"https:\/\/docs.pytorch.org\/tutorials\/beginner\/deep_learning_60min_blitz.html\" target=\"_blank\" rel=\"noopener noreferrer\">PyTorch Tutorial<\/a><\/p>\n\n\n\n<h2 id=\"outline__4\" class=\"wp-block-heading\">PyTorch Lightning\u3068\u306f\uff1f\u62e1\u5f35\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u6982\u8981\u3068\u7279\u5fb4<\/h2>\n\n\n\n<h3 id=\"outline__4_1\" class=\"wp-block-heading\">\u30b3\u30fc\u30c9\u3092\u7c21\u6f54\u306b\u3059\u308b\u62e1\u5f35\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4e3b\u306a\u7279\u5fb4<\/h3>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/images\/techmania\/thumbnail\/images\/PyTorch_Lightnig_Top.webp\" class=\"post-img\" alt=\"PyTorch Lightning\u30c8\u30c3\u30d7\u753b\u9762\" loading=\"lazy\"><\/p>\n<p style=\"font-size: 13px; color: #666; text-align: center; margin-top: 8px;\">\u51fa\u5178:<a href=\"https:\/\/lightning.ai\/docs\/pytorch\/stable\/\" target=\"_blank\" rel=\"noopener noreferrer\">PyTorch Lightning<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch Lightning\u306f\u3001PyTorch\u306e\u67d4\u8edf\u6027\u3092\u7dad\u6301\u3057\u306a\u304c\u3089\u30b3\u30fc\u30c9\u3092\u6574\u7406\u3057\u3001\u7c21\u7565\u5316\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u958b\u767a\u52b9\u7387\u3092\u5411\u4e0a\u3059\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u5e38\u306ePyTorch\u3067\u306f\u3001\u5b66\u7fd2\u30fb\u691c\u8a3c\u30fb\u30c6\u30b9\u30c8\u30fb\u30e2\u30c7\u30eb\u4fdd\u5b58\u30fbGPU\u5207\u308a\u66ff\u3048\u306a\u3069\u3092\u81ea\u5206\u3067\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u30e2\u30c7\u30eb\u672c\u4f53\u3088\u308a\u3082\u8a13\u7df4\u30eb\u30fc\u30d7\u306e\u30b3\u30fc\u30c9\u306e\u65b9\u304c\u9577\u304f\u306a\u308b\u30b1\u30fc\u30b9\u3082\u5c11\u306a\u304f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65b9\u3001PyTorch Lightning\u3067\u306f\u3001\u8a13\u7df4\u30eb\u30fc\u30d7\u3084GPU\u7ba1\u7406\u306a\u3069\u306e\u5b9a\u578b\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u5316\u3057\u3066\u304f\u308c\u308b\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u3002<br>\u30e2\u30c7\u30eb\u3068\u5b66\u7fd2\u51e6\u7406\u3092\u5b9a\u7fa9\u3057\u305f<a href=\"https:\/\/techmania.jp\/blog\/programming0004\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\u30af\u30e9\u30b9<\/a>\u3092\u5b9f\u88c5\u3057\u3001Trainer\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u3066\u5b66\u7fd2\u5168\u4f53\u3092\u7ba1\u7406\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u5b9a\u578b\u51e6\u7406\u304c\u81ea\u52d5\u3067\u5b9f\u884c\u3055\u308c\u308b\u305f\u3081\u3001\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u306b\u3088\u308a\u3001\u5168\u4f53\u306e<span class=\"c-user01\" style=\"font-weight:bold;\">\u30b3\u30fc\u30c9\u91cf\u3092\u524a\u6e1b<\/span>\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001<span class=\"c-user01\" style=\"font-weight:bold;\">\u53ef\u8aad\u6027<\/span>\u3084\u4fdd\u5b88\u6027\u304c\u5411\u4e0a\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 id=\"outline__4_2\" class=\"wp-block-heading\">\u5c0e\u5165\u624b\u9806\u3068\u5b9f\u88c5\u306e\u5909\u5316<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch Lightning\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(14px, .875rem, 21px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#304047;color:#d5ffff\">Bash<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>pip install lightning<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki material-theme\" style=\"background-color: #263238\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">pip<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">install<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">lightning<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9f\u969b\u306b\u3001PyTorch\u306e\u307f\u3068 PyTorch Lightning\u3092\u4f7f\u3063\u305f\u5834\u5408\u306e\u9055\u3044\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(14px, .875rem, 21px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#304047;color:#d5ffff\">\u4f8b (PyTorch)<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>import torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nmodel = nn.Linear(10, 1)\noptimizer = optim.SGD(model.parameters(), lr=0.01)\n\noutput = model(x)\nloss = nn.MSELoss()(output, y)\n\noptimizer.zero_grad()\nloss.backward()\noptimizer.step()<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki material-theme\" style=\"background-color: #263238\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #89DDFF; font-style: italic\">import<\/span><span style=\"color: #EEFFFF\"> torch<\/span><\/span>\n<span class=\"line\"><span style=\"color: #89DDFF; font-style: italic\">import<\/span><span style=\"color: #EEFFFF\"> torch<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #F07178\">nn<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF; font-style: italic\">as<\/span><span style=\"color: #EEFFFF\"> nn<\/span><\/span>\n<span class=\"line\"><span style=\"color: #89DDFF; font-style: italic\">import<\/span><span style=\"color: #EEFFFF\"> torch<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #F07178\">optim<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF; font-style: italic\">as<\/span><span style=\"color: #EEFFFF\"> optim<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">model <\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #EEFFFF\"> nn<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">Linear<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #F78C6C\">10<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #82AAFF\"> <\/span><span style=\"color: #F78C6C\">1<\/span><span style=\"color: #89DDFF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">optimizer <\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #EEFFFF\"> optim<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">SGD<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #82AAFF\">model<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">parameters<\/span><span style=\"color: #89DDFF\">(),<\/span><span style=\"color: #82AAFF\"> <\/span><span style=\"color: #EEFFFF; font-style: italic\">lr<\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #F78C6C\">0.01<\/span><span style=\"color: #89DDFF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">output <\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #82AAFF\">model<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #82AAFF\">x<\/span><span style=\"color: #89DDFF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">loss <\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #EEFFFF\"> nn<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">MSELoss<\/span><span style=\"color: #89DDFF\">()(<\/span><span style=\"color: #82AAFF\">output<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #82AAFF\"> y<\/span><span style=\"color: #89DDFF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">optimizer<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">zero_grad<\/span><span style=\"color: #89DDFF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">loss<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">backward<\/span><span style=\"color: #89DDFF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">optimizer<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">step<\/span><span style=\"color: #89DDFF\">()<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch\u306e\u5834\u5408\u306f\u3001<code>zero_grad()<\/code>\u3001<code>backward()<\/code>\u3001<code>step()<\/code>\u3068\u3044\u3063\u305f\u5b66\u7fd2\u51e6\u7406\u3092\u81ea\u5206\u3067\u6bce\u56de\u66f8\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65b9\u3001Lightning\u3067\u306f\u3001\u5b66\u7fd2\u51e6\u7406\u3092<code>training_step()<\/code>\u3078\u8a18\u8ff0\u3057\u3001Trainer\u304c\u8a13\u7df4\u30eb\u30fc\u30d7\u3092\u7ba1\u7406\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(14px, .875rem, 21px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#304047;color:#d5ffff\">\u4f8b (PyTorch Lightning)<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>\u4f8b (PyTorch Lightning) :\nimport lightning as L\nimport torch.nn as nn\n\nclass Model(L.LightningModule):\ndef init(self):\nsuper().init()\nself.model = nn.Linear(10, 1)\n\ndef training_step(self, batch, batch_idx):\n    x, y = batch\n    return nn.MSELoss()(self.model(x), y)\n\ndef configure_optimizers(self):\n    return torch.optim.SGD(self.parameters(), lr=0.01)<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki material-theme\" style=\"background-color: #263238\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">\u4f8b <\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #82AAFF\">PyTorch Lightning<\/span><span style=\"color: #89DDFF\">)<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #89DDFF; font-style: italic\">import<\/span><span style=\"color: #EEFFFF\"> lightning <\/span><span style=\"color: #89DDFF; font-style: italic\">as<\/span><span style=\"color: #EEFFFF\"> L<\/span><\/span>\n<span class=\"line\"><span style=\"color: #89DDFF; font-style: italic\">import<\/span><span style=\"color: #EEFFFF\"> torch<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #F07178\">nn<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF; font-style: italic\">as<\/span><span style=\"color: #EEFFFF\"> nn<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #C792EA\">class<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #FFCB6B\">Model<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #FFCB6B\">L<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #FFCB6B\">LightningModule<\/span><span style=\"color: #89DDFF\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #C792EA\">def<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #82AAFF\">init<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #F07178; font-style: italic\">self<\/span><span style=\"color: #89DDFF\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">super<\/span><span style=\"color: #89DDFF\">().<\/span><span style=\"color: #82AAFF\">init<\/span><span style=\"color: #89DDFF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">self<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #F07178\">model<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #EEFFFF\"> nn<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">Linear<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #F78C6C\">10<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #82AAFF\"> <\/span><span style=\"color: #F78C6C\">1<\/span><span style=\"color: #89DDFF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #C792EA\">def<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #82AAFF\">training_step<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #F07178; font-style: italic\">self<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #EEFFFF; font-style: italic\">batch<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #EEFFFF; font-style: italic\">batch_idx<\/span><span style=\"color: #89DDFF\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    x<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #EEFFFF\"> y <\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #EEFFFF\"> batch<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #89DDFF; font-style: italic\">return<\/span><span style=\"color: #EEFFFF\"> nn<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">MSELoss<\/span><span style=\"color: #89DDFF\">()(<\/span><span style=\"color: #EEFFFF\">self<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">model<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #82AAFF\">x<\/span><span style=\"color: #89DDFF\">),<\/span><span style=\"color: #82AAFF\"> y<\/span><span style=\"color: #89DDFF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #C792EA\">def<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #82AAFF\">configure_optimizers<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #F07178; font-style: italic\">self<\/span><span style=\"color: #89DDFF\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #89DDFF; font-style: italic\">return<\/span><span style=\"color: #EEFFFF\"> torch<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #F07178\">optim<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">SGD<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #EEFFFF\">self<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">parameters<\/span><span style=\"color: #89DDFF\">(),<\/span><span style=\"color: #82AAFF\"> <\/span><span style=\"color: #EEFFFF; font-style: italic\">lr<\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #F78C6C\">0.01<\/span><span style=\"color: #89DDFF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b66\u7fd2\u306f\u6b21\u306e\u3088\u3046\u306b\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(14px, .875rem, 21px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#304047;color:#d5ffff\">\u5b9f\u884c<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>trainer = L.Trainer(max_epochs=10)\ntrainer.fit(model, train_dataloader)<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki material-theme\" style=\"background-color: #263238\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EEFFFF\">trainer <\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #EEFFFF\"> L<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">Trainer<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #EEFFFF; font-style: italic\">max_epochs<\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #F78C6C\">10<\/span><span style=\"color: #89DDFF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">trainer<\/span><span style=\"color: #89DDFF\">.<\/span><span style=\"color: #82AAFF\">fit<\/span><span style=\"color: #89DDFF\">(<\/span><span style=\"color: #82AAFF\">model<\/span><span style=\"color: #89DDFF\">,<\/span><span style=\"color: #82AAFF\"> train_dataloader<\/span><span style=\"color: #89DDFF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u306e\u30b5\u30f3\u30d7\u30eb\u3060\u3051\u3092\u898b\u308b\u3068\u30b3\u30fc\u30c9\u91cf\u306b\u5927\u304d\u306a\u5dee\u306f\u306a\u3044\u3088\u3046\u306b\u601d\u3048\u307e\u3059\u304c\u3001\u8a13\u7df4\u30eb\u30fc\u30d7\u306e\u7ba1\u7406\u3092\u81ea\u524d\u3067\u884c\u3046\u5fc5\u8981\u304c\u306a\u3044\u305f\u3081\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u5168\u4f53\u3067\u898b\u308b\u3068\u30b3\u30fc\u30c9\u306e\u898b\u901a\u3057\u304c\u3050\u3063\u3068\u3088\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Trainer\u3092\u5229\u7528\u3059\u308c\u3070\u30a8\u30dd\u30c3\u30af\u7ba1\u7406\u3084GPU\u5229\u7528\u3001\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u4fdd\u5b58\u3001Early Stopping\u306a\u3069\u3082\u7c21\u6f54\u306b\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__5\" class=\"wp-block-heading\">PyTorch\u3092\u5b66\u3076\u305f\u3081\u306e\u304a\u3059\u3059\u3081\u5b66\u7fd2\u30ea\u30bd\u30fc\u30b9<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch\u3092\u5b66\u3076\u969b\u306f\u3001\u307e\u305a\u4e0a\u8ff0\u306e\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u30c6\u30f3\u30bd\u30eb\u3084\u81ea\u52d5\u5fae\u5206\u3001\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u57fa\u790e\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<br>\u305d\u306e\u5f8c\u3001\u753b\u50cf\u5206\u985e\u3084\u81ea\u7136\u8a00\u8a9e\u51e6\u7406\u306a\u3069\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u5b9f\u969b\u306b\u52d5\u304b\u3057\u306a\u304c\u3089\u5b66\u7fd2\u3059\u308b\u3068\u7406\u89e3\u304c\u6df1\u307e\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305f\u3001Hugging Face Transformers \u306a\u3069\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u5408\u308f\u305b\u3066\u5229\u7528\u3059\u308b\u306e\u30821\u3064\u306e\u624b\u3067\u3059\u3002<br>Transformers\u306f PyTorch\u3068\u9023\u643a\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u524d\u63d0\u3068\u3057\u3066\u3044\u3066\u3001BERT\u3084GPT\u306a\u3069\u306e\u4e8b\u524d\u5b66\u7fd2\u6e08\u307f\u30e2\u30c7\u30eb\u3092PyTorch\u4e0a\u3067\u6271\u3048\u308b\u305f\u3081\u3001\u6700\u65b0\u306e\u751f\u6210AI\u6280\u8853\u306b\u3082\u89e6\u308c\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u306e\u4ed6\u3001\u52d5\u753b\u6559\u6750\u3084\u30aa\u30f3\u30e9\u30a4\u30f3\u8b1b\u5ea7\u3001<a href=\"https:\/\/techmania.jp\/blog\/github0001\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">GitHub<\/a>\u4e0a\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306a\u3069\u3082\u4f75\u7528\u3057\u3066\u3001\u5b9f\u969b\u306b\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u30fb\u5b66\u7fd2\u30fb\u63a8\u8ad6\u3059\u308b\u7d4c\u9a13\u3092\u7a4d\u3080\u3053\u3068\u304c\u7fd2\u5f97\u3078\u306e\u8fd1\u9053\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"techmania-recirc\">\n<style>\n.techmania-recirc{margin:24px 0;font-family:-apple-system,\"Hiragino Kaku Gothic ProN\",\"Yu Gothic\",sans-serif;}\n.techmania-recirc__label{font-size:14px;color:#333;margin-bottom:8px;font-weight:bold;}\n.techmania-recirc__box{display:flex;align-items:center;gap:16px;border:1px solid #ddd;border-radius:4px;padding:12px 16px;text-decoration:none;transition:background .2s;}\n.techmania-recirc__box:hover{background:#f7f9fc;}\n.techmania-recirc__thumb{width:96px;aspect-ratio:6\/4;object-fit:cover;border-radius:4px;flex-shrink:0;}\n.techmania-recirc__title{color:#2952cc;font-size:15px;line-height:1.6;flex:1;}\n.techmania-recirc__arrow{flex-shrink:0;width:28px;height:28px;border-radius:50%;background:#2952cc;color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;}\n<\/style>\n<div class=\"techmania-recirc__label\">\u25bc\u3053\u3061\u3089\u3082\u30c1\u30a7\u30c3\u30af\u25bc<\/div>\n<a class=\"techmania-recirc__box\" href=\"https:\/\/techmania.jp\/blog\/hugging-face\/\">\n  <img decoding=\"async\" class=\"techmania-recirc__thumb\" src=\"https:\/\/web-img.rensa.jp.net\/images\/techmania\/thumbnail\/images\/hugging_face.webp\" alt=\"Hugging Face\u3068\u306f\uff1fAI\u30e2\u30c7\u30eb\u5171\u6709\u306e\u4ed5\u7d44\u307f\u3068\u4f7f\u3044\u65b9\u3092\u89e3\u8aac\">\n  <span class=\"techmania-recirc__title\">Hugging Face\u3068\u306f\uff1fAI\u30e2\u30c7\u30eb\u5171\u6709\u306e\u4ed5\u7d44\u307f\u3068\u4f7f\u3044\u65b9\u3092\u89e3\u8aac<\/span>\n  <span class=\"techmania-recirc__arrow\">\u25b6<\/span>\n<\/a>\n<\/div>\n\n\n\n<h2 id=\"outline__6\" class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">PyTorch\u306f\u3001\u73fe\u5728\u306eAI\u30fb\u6a5f\u68b0\u5b66\u7fd2\u958b\u767a\u3092\u652f\u3048\u308b\u4ee3\u8868\u7684\u306a\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<br>\u52d5\u7684\u8a08\u7b97\u30b0\u30e9\u30d5\u306b\u3088\u308b\u9ad8\u3044\u67d4\u8edf\u6027\u3068Python\u3089\u3057\u3044\u8a18\u8ff0\u6027\u3092\u5099\u3048\u3001\u7814\u7a76\u7528\u9014\u3060\u3051\u3067\u306a\u304f\u5546\u7528\u958b\u767a\u3067\u3082\u5e83\u304f\u5229\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br>\u5b9f\u969b\u306b\u73fe\u5834\u3067TensorFlow\u304b\u3089\u306e\u4e57\u308a\u63db\u3048\u76f8\u8ac7\u3092\u53d7\u3051\u308b\u3053\u3068\u3082\u591a\u3044\u306e\u3067\u3059\u304c\u3001<span class=\"c-user01\" style=\"font-weight:bold;\">\u30c7\u30d0\u30c3\u30b0\u306e\u3057\u3084\u3059\u3055<\/span>\u3060\u3051\u3067\u3082PyTorch\u3092\u52e7\u3081\u308b\u4fa1\u5024\u304c\u3042\u308b\u3068\u611f\u3058\u3066\u3044\u307e\u3059\u3002<br><span class=\"c-user01\" style=\"font-weight:bold;\">\u3053\u308c\u304b\u3089AI\u3084\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u3092\u5b66\u3073\u59cb\u3081\u308b\u65b9\u306b\u3082\u3001\u307e\u305a\u306f\u89e6\u3063\u3066\u307f\u3066\u307b\u3057\u3044\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\uff01<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n<p><script type=\"application\/ld+json\"><br \/>\n  {<br \/>\n    \"@context\": \"https:\/\/schema.org\",<br \/>\n    \"@type\": \"BreadcrumbList\",<br \/>\n    \"itemListElement\": [<br \/>\n      {<br \/>\n        \"@type\": \"ListItem\",<br \/>\n        \"position\": 1,<br \/>\n        \"name\": \"TechMania \u73fe\u5f79\u30d7\u30ed\u30b0\u30e9\u30de\u306e\u6280\u8853\u30d6\u30ed\u30b0\",<br \/>\n        \"item\": \"https:\/\/techmania.jp\/blog\/\"<br \/>\n      },<br \/>\n      {<br \/>\n        \"@type\": \"ListItem\",<br \/>\n        \"position\": 2,<br \/>\n        \"name\": \"AI\u30fb\u6a5f\u68b0\u5b66\u7fd2\",<br \/>\n        \"item\": \"https:\/\/techmania.jp\/blog\/category\/ai-ml\/\"<br \/>\n      },<br \/>\n      {<br \/>\n        \"@type\": \"ListItem\",<br \/>\n        \"position\": 3,<br \/>\n        \"name\": \"PyTorch\u3068\u306f\uff1f\u7279\u5fb4\u3084\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u3001\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u89e3\u8aac\",<br \/>\n        \"item\": \"https:\/\/techmania.jp\/blog\/pytorch\/\"<br \/>\n      }<br \/>\n    ]<br \/>\n  }<br \/>\n<\/script><\/p>\n<p><script type=\"application\/ld+json\"><br \/>\n  {<br \/>\n    \"@context\": \"https:\/\/schema.org\",<br \/>\n    \"@type\": \"Article\",<br \/>\n    \"headline\": \"PyTorch\u3068\u306f\uff1f\u7279\u5fb4\u3084\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u3001\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u89e3\u8aac\",<br \/>\n    \"description\": \"PyTorch\u3068\u306f\u3001Meta\u793e\u304c\u958b\u767a\u3057\u305f\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3001\u52d5\u7684\u8a08\u7b97\u30b0\u30e9\u30d5\u306b\u3088\u308b\u67d4\u8edf\u6027\u3068Python\u3089\u3057\u3044\u8a18\u8ff0\u6027\u304c\u7279\u5fb4\u3067\u3059\u3002\u672c\u8a18\u4e8b\u3067\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u3084\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3001\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u64cd\u4f5c\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002\",<br \/>\n    \"url\": \"https:\/\/techmania.jp\/blog\/pytorch\/\",<br \/>\n    \"image\": \"https:\/\/web-img.rensa.jp.net\/images\/techmania\/thumbnail\/images\/PyTorch.webp\",<br \/>\n    \"datePublished\": \"2026-07-23\",<br \/>\n    \"dateModified\": \"2026-07-23\",<br \/>\n    \"author\": {<br \/>\n      \"@type\": \"Person\",<br \/>\n      \"@id\": \"https:\/\/techmania.jp\/blog\/#person\",<br \/>\n      \"name\": \"\u30c6\u30c3\u30af\u30de\u30cb\u30a2\u7de8\u96c6\u90e8 \u65e9\u5ddd\",<br \/>\n      \"url\": \"https:\/\/techmania.jp\/blog\/author\/k-h\/\",<br \/>\n      \"jobTitle\": \"\u73fe\u5f79\u30d7\u30ed\u30b0\u30e9\u30de\u30fc \/ \u6280\u8853\u76e3\u4fee\",<br \/>\n      \"description\": \"5\u5e74\u4ee5\u4e0a\u306b\u6e21\u308aiOS\u3001Web\u30a2\u30d7\u30ea\u958b\u767a\u306b\u304a\u3044\u3066\u3001\u8a2d\u8a08\u304b\u3089\u4fdd\u5b88\u307e\u3067\u4e00\u8cab\u3057\u305f\u5b9f\u52d9\u7d4c\u9a13\u304c\u3042\u308b\u3002Swift\u3001Objective-C\u3001Firebase\u3001AppsFlyer\u3001Repro\u306b\u7cbe\u901a\u3002 \u76f4\u8fd1\u3067\u306fPython\u3084JavaScript\u3092\u7528\u3044\u305fWeb\u958b\u767a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u643a\u308f\u308a\u3001Django\u3001DBeaver\u306a\u3069\u5e45\u3092\u5e83\u3052\u3066\u3044\u308b\u3002IT\u6280\u8853\u30e1\u30c7\u30a3\u30a2TechMania\u3067\u306f\u3001\u6280\u8853\u76e3\u4fee\u3068\u3057\u3066\u73fe\u5834\u306e\u30c8\u30e9\u30d6\u30eb\u3084\u6700\u65b0\u306e\u6280\u8853\u4ed5\u69d8\u306b\u57fa\u3065\u3044\u305f\u3001\u6709\u76ca\u306a\u60c5\u5831\u3092\u767a\u4fe1\u3002\u904b\u55b6\u5143\u30fb\u682a\u5f0f\u4f1a\u793e\u30ec\u30f3\u30b5\u304c\u4fdd\u6709\u3059\u308bIT\u6280\u8853\u60c5\u5831\u3068\u3068\u3082\u306b\u3001\u521d\u5fc3\u8005\u306b\u3082\u5206\u304b\u308a\u3084\u3059\u304f\u3001\u73fe\u5834\u3067\u4f7f\u3048\u308b\u6280\u8853\u3092\u5c4a\u3051\u3066\u3044\u308b\u3002\"<br \/>\n    },<br \/>\n    \"publisher\": {<br \/>\n      \"@type\": \"Organization\",<br \/>\n      \"name\": \"\u682a\u5f0f\u4f1a\u793e\u30ec\u30f3\u30b5\",<br \/>\n      \"url\": \"https:\/\/rensa.co.jp\/\",<br \/>\n      \"logo\": {<br \/>\n        \"@type\": \"ImageObject\",<br \/>\n        \"url\": \"https:\/\/rensa.co.jp\/wp-content\/uploads\/2018\/10\/r-logo2.png\"<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n<\/script><\/p>\n<p><script type=\"application\/ld+json\"><br \/>\n  {<br \/>\n    \"@context\": \"https:\/\/schema.org\",<br \/>\n    \"@type\": \"Organization\",<br \/>\n    \"name\": \"\u682a\u5f0f\u4f1a\u793e\u30ec\u30f3\u30b5\",<br \/>\n    \"url\": \"https:\/\/rensa.co.jp\/\",<br \/>\n    \"alternateName\": \"RENSA\",<br \/>\n    \"foundingDate\": \"2011-02-18\",<br \/>\n    \"telephone\": \"03-6457-5500\",<br \/>\n    \"description\": \"\u682a\u5f0f\u4f1a\u793e\u30ec\u30f3\u30b5\u306f\u3001\u81ea\u793e\u30b3\u30f3\u30c6\u30f3\u30c4\u904b\u7528\u3092\u8ef8\u306b\u300c\u30aa\u30a6\u30f3\u30c9\u30e1\u30c7\u30a3\u30a2\u904b\u55b6\u300d\u300c\u5404\u30e1\u30c7\u30a3\u30a2\u306e\u5e83\u544a\u904b\u7528\u300d\u300c\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u80b2\u6210\u300d\u300c\u30b7\u30b9\u30c6\u30e0\u30a8\u30f3\u30b8\u30cb\u30a2\u30ea\u30f3\u30b0\u4e8b\u696d\u300d\u3092\u5c55\u958b\u3057\u3066\u3044\u307e\u3059\u3002\u6e29\u5ea6\u3092\u611f\u3058\u308b\u30af\u30ea\u30a8\u30a4\u30c6\u30a3\u30d6\u3068\u30a8\u30f3\u30b8\u30cb\u30a2\u30ea\u30f3\u30b0\u3067\u793e\u4f1a\u306b\u8ca2\u732e\u3057\u307e\u3059\u3002\",<br \/>\n    \"logo\": \"https:\/\/rensa.co.jp\/wp-content\/uploads\/2018\/10\/r-logo2.png\",<br \/>\n    \"founder\": {<br \/>\n      \"@type\": \"Person\",<br \/>\n      \"name\": \"\u6b66\u4e95 \u54f2\u4e5f\",<br \/>\n      \"jobTitle\": \"\u4ee3\u8868\u53d6\u7de0\u5f79\"<br \/>\n    },<br \/>\n    \"address\": {<br \/>\n      \"@type\": \"PostalAddress\",<br \/>\n      \"streetAddress\": \"\u5343\u99c4\u30f6\u8c373-16-5 MUPRE\u5317\u53c2\u90532\u968e\",<br \/>\n      \"addressLocality\": \"\u6e0b\u8c37\u533a\",<br \/>\n      \"addressRegion\": \"\u6771\u4eac\u90fd\",<br \/>\n      \"postalCode\": \"151-0051\",<br \/>\n      \"addressCountry\": \"JP\"<br \/>\n    }<br \/>\n  }<br \/>\n<\/script><\/p>\n<p><script type=\"application\/ld+json\"><br \/>\n  {<br \/>\n    \"@context\": \"https:\/\/schema.org\",<br \/>\n    \"@type\": \"ProfilePage\",<br \/>\n    \"mainEntity\": {<br \/>\n      \"@type\": \"Person\",<br \/>\n      \"@id\": \"https:\/\/techmania.jp\/blog\/#person\",<br \/>\n      \"name\": \"\u30c6\u30c3\u30af\u30de\u30cb\u30a2\u7de8\u96c6\u90e8 \u65e9\u5ddd\",<br \/>\n      \"jobTitle\": \"\u73fe\u5f79\u30d7\u30ed\u30b0\u30e9\u30de\u30fc \/ \u6280\u8853\u76e3\u4fee\",<br \/>\n      \"description\": \"5\u5e74\u4ee5\u4e0a\u306b\u6e21\u308aiOS\u3001Web\u30a2\u30d7\u30ea\u958b\u767a\u306b\u304a\u3044\u3066\u3001\u8a2d\u8a08\u304b\u3089\u4fdd\u5b88\u307e\u3067\u4e00\u8cab\u3057\u305f\u5b9f\u52d9\u7d4c\u9a13\u304c\u3042\u308b\u3002Swift\u3001Objective-C\u3001Firebase\u3001AppsFlyer\u3001Repro\u306b\u7cbe\u901a\u3002 \u76f4\u8fd1\u3067\u306fPython\u3084JavaScript\u3092\u7528\u3044\u305fWeb\u958b\u767a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u643a\u308f\u308a\u3001Django\u3001DBeaver\u306a\u3069\u5e45\u3092\u5e83\u3052\u3066\u3044\u308b\u3002IT\u6280\u8853\u30e1\u30c7\u30a3\u30a2TechMania\u3067\u306f\u3001\u6280\u8853\u76e3\u4fee\u3068\u3057\u3066\u73fe\u5834\u306e\u30c8\u30e9\u30d6\u30eb\u3084\u6700\u65b0\u306e\u6280\u8853\u4ed5\u69d8\u306b\u57fa\u3065\u3044\u305f\u3001\u6709\u76ca\u306a\u60c5\u5831\u3092\u767a\u4fe1\u3002\u904b\u55b6\u5143\u30fb\u682a\u5f0f\u4f1a\u793e\u30ec\u30f3\u30b5\u304c\u4fdd\u6709\u3059\u308bIT\u6280\u8853\u60c5\u5831\u3068\u3068\u3082\u306b\u3001\u521d\u5fc3\u8005\u306b\u3082\u5206\u304b\u308a\u3084\u3059\u304f\u3001\u73fe\u5834\u3067\u4f7f\u3048\u308b\u6280\u8853\u3092\u5c4a\u3051\u3066\u3044\u308b\u3002\",<br \/>\n      \"url\": \"https:\/\/techmania.jp\/blog\/author\/k-h\/\",<br \/>\n      \"knowsAbout\": [<br \/>\n        \"Objective-C\", \"Swift\", \"HTML\", \"CSS\", \"JavaScript\", \"Python\", \"Django\", \"Xcode\", \"VS Code\", \"Docker\", \"Git\", \"Firebase\"<br \/>\n      ],<br \/>\n      \"hasOccupation\": [<br \/>\n        {<br \/>\n          \"@type\": \"Occupation\",<br \/>\n          \"name\": \"iOS\u30a2\u30d7\u30ea\u904b\u7528\u30fb\u4fdd\u5b88\u30a8\u30f3\u30b8\u30cb\u30a2\",<br \/>\n          \"description\": \"2019\u5e7412\u6708\u304b\u30895\u5e746\u30f6\u6708\u306eiOS\u30a2\u30d7\u30ea\u958b\u767a\u30fb\u4fdd\u5b88\u7d4c\u9a13\"<br \/>\n        },<br \/>\n        {<br \/>\n          \"@type\": \"Occupation\",<br \/>\n          \"name\": \"Web\u30b5\u30a4\u30c8\u904b\u7528\u30fb\u4fdd\u5b88\u30a8\u30f3\u30b8\u30cb\u30a2\",<br \/>\n          \"description\": \"2025\u5e7410\u6708\u304b\u3089\u306eWeb\u30b7\u30b9\u30c6\u30e0\uff08Python\/Django\uff09\u904b\u7528\u30fb\u4fdd\u5b88\u7d4c\u9a13\"<br \/>\n        }<br \/>\n      ],<br \/>\n      \"worksFor\": {<br \/>\n        \"@type\": \"Organization\",<br \/>\n        \"name\": \"\u682a\u5f0f\u4f1a\u793e\u30ec\u30f3\u30b5\",<br \/>\n        \"sameAs\": \"https:\/\/rensa.co.jp\/\"<br \/>\n      },<br \/>\n      \"affiliation\": {<br \/>\n        \"@type\": \"Organization\",<br \/>\n        \"name\": \"\u30c6\u30c3\u30af\u30de\u30cb\u30a2\"<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n<\/script><\/p>","protected":false},"excerpt":{"rendered":"PyTorch\u306f\u3001Meta\u793e\u304c\u958b\u767a\u3057\u305f\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\u52d5\u7684\u8a08\u7b97\u30b0\u30e9\u30d5\u306b\u3088\u308b\u67d4\u8edf\u6027\u3068Python\u3089\u3057\u3044\u8a18\u8ff0\u6027\u304c\u7279\u5fb4\u3067\u3059\u3002\u672c\u8a18\u4e8b\u3067\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u3084\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3001\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u64cd\u4f5c\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002","protected":false},"author":12,"featured_media":10762,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"fifu_image_url":"https:\/\/web-img.rensa.jp.net\/images\/techmania\/thumbnail\/images\/PyTorch.webp","fifu_image_alt":"\u3010PyTorch\u3068\u306f\u3011\u7279\u5fb4\u3084\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u3001\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u89e3\u8aac","footnotes":""},"categories":[105],"tags":[],"class_list":["post-10747","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-ml"],"_links":{"self":[{"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/posts\/10747","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/comments?post=10747"}],"version-history":[{"count":22,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/posts\/10747\/revisions"}],"predecessor-version":[{"id":10780,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/posts\/10747\/revisions\/10780"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/media\/10762"}],"wp:attachment":[{"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/media?parent=10747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/categories?post=10747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/tags?post=10747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}