Giter VIP home page Giter VIP logo

Comments (1)

YutaroOgawa avatar YutaroOgawa commented on July 22, 2024 2

@c-bata さま

ありがとうございます。
返答が週末になり申し訳ございません。

おっしゃる通りで、c-bataさまの書き方が通常になります。

この部分については私の説明不足です。

初めてDatasetを自作する人に向けて、
Datasetには
len
getitem
を定義する必要があること、

__getitem__で要素が取り出せることを明示的に示したく、現在の記述になっています。

https://pytorch.org/tutorials/beginner/data_loading_tutorial.html
のページにもあるように、

getitem to support the indexing such that dataset[i] can be used to get ith sample

であり、Datasetに対して、c-sabaさんの書き方で、実質的には__getitem__が実行されます。

その旨を本書にも丁寧に記述したうえで、c-sabaさんの上記の内容を加筆するとさらに良いと思いました。

本当は増刷時の修正で、いただいた提言を書き加えたいのですが、書籍のページ数などが変わるレベルになるので、申し訳ございませんが、すぐに修正として書籍に反映させることが困難です。

「この__getitem__で取り出す以外にも、c-sabaさんのように書くことが普通ですよ」
ということが、熱心な読者の方にも伝わるように、本issueを公開のまま残させてください。

より良くするための様々な提言をいただけ、非常に感謝しております。

誠にありがとうございます。

from pytorch_advanced.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.