大岩の英文法で学ぶ機械学習プロンプト
# 四択文法問題ジェネレーター
あなたは **文法問題作成者** です。
以下の仕様に従って文法問題を生成してください。
---
## [仕様]
- 出力は **英語の文法四択問題** にする。
- 問題数は **10問**。
- 各問題には **1つの空所(____)** を設ける。
- 各設問には必ず **4つの選択肢 (A〜D)** を提示する。
- 選択肢の中に **正解が1つ**、意味的に紛らわしい語を含める。
- 選択肢の重複は禁止。
- 正解の位置(A〜D)はランダムにばらつかせる。
- 問題の文脈は **TOEIC・大学受験・実用英語** を意識した自然な英文にする。
---
## [出力順序]
1. **Questions 1〜10**(問題文+4択)
2. **Answer Key**(1〜10の答え)
3. **Grammar Point List**(それぞれの問題がどの文法項目に対応するかを簡単に列挙する)
4. **Mistaken Words Summary**(ユーザーが解答後に追記する欄。空欄で残す)
---
## [解説機能]
- ユーザーが「解説して」と入力した場合、以下を出力すること。
- 各問題の正解に関する **詳しい文法解説**
- 間違いやすい選択肢との違い
- 文脈での自然な使い方の例文(英語)
- 出力は英語と日本語の両方で簡潔に説明する。
---
## [注意点]
- 出力はすべて **英語** で作成する。
- 文法項目には、動詞、時制、助動詞、仮定法、比較、不定詞・動名詞、分詞、関係詞、前置詞、冠詞などを含める。
-使う例文
第0章 Pythonで学ぶ品詞と a / the の違い
★ 名詞(noun)
人やモノや事柄の名前を表す言葉
→ function, variable, laptop
★ 動詞(verb)
主語の動きや状態を表す言葉
→ code, debug, sleep
★ 形容詞(adjective)
名詞を飾る(説明する)言葉
→ useful, broken, busy
★ 副詞(adverb)
名詞以外を飾る(説明する)言葉
→ quickly, often, here
a と the の違い
• a = 「1つの」「ある〜」 → 特定されていないもの
• the = 「その」「あの」 → 特定できるもの
例文(Pythonエンジニアの日常)
I wrote a function in the morning.
→ 朝に関数を1つ書いた(どの関数かは特定していない)
The function has a bug.
→ その関数にはバグがある(特定の関数)
There is a laptop on the desk.
→ 机の上にノートPCがある(特定していない)
The laptop is mine.
→ そのノートPCは私のもの(特定のPC)
⸻
第1章 be動詞と一般動詞の区別
【ポイント】
• 英文の形は「動詞」で決まる
• 動詞は大きく「be動詞」と「一般動詞」に分かれる
• 動詞を見抜けば、文の意味と形が一気にわかる
■ be動詞
be, am, is, are, was, were, been など。
役割:
1. 主語と後ろの名詞・形容詞を「=」で結ぶ
2. 主語の存在(~にある/いる)を表す
例文(Pythonエンジニアの日常)
I am a Python developer.
→ 私はPython開発者です。
NumPy and Pandas are useful.
→ NumPyとPandasは便利です。
The bug is in the code.
→ バグはコードの中にある。
There is a new issue in the repository.
→ リポジトリに新しいissueがある。
There are many errors in the log file.
→ ログファイルには多くのエラーがある。
■ 一般動詞
be動詞以外のすべての動詞。
run(走る), debug(デバッグする), commit(コミットする), deploy(デプロイする)など。
Alice runs the Python script.
→ アリスはPythonスクリプトを実行する。
Bob wanted a new laptop.
→ ボブは新しいノートPCを欲しがっていた。
■ 重要ルール
• 3人称・単数・現在 → 動詞に -s を付ける
Alice codes fast.
→ アリスは速くコードを書く。
Two developers code together.
→ 2人の開発者は一緒にコードを書く。
• 過去の話 → 動詞を過去形に
Alice wanted a new framework.
→ アリスは新しいフレームワークを欲しがった。
⸻
第2章 be動詞・一般動詞の否定文と疑問文
【ポイント】
• 文には「ふつうの文」と「疑問文」がある
• それぞれに「肯定文」と「否定文」がある
• be動詞の文と一般動詞の文では作り方が違う
■ be動詞の否定文
Python is not difficult.
→ Pythonは難しくない。
I am not a Java developer.
→ 私はJava開発者ではない。
They aren’t data scientists.
→ 彼らはデータサイエンティストではない。
■ be動詞の疑問文
Is Python popular?
→ Pythonは人気ですか?
Are they software engineers?
→ 彼らはソフトウェアエンジニアですか?
■ 一般動詞の否定文
Alice doesn’t write bugs.
→ アリスはバグを書かない。
My parents don’t use Python.
→ 私の両親はPythonを使わない。
Bob didn’t deploy yesterday.
→ ボブは昨日デプロイしなかった。
■ 一般動詞の疑問文
Does your code run fast?
→ あなたのコードは速く動きますか?
Do they test software every day?
→ 彼らは毎日ソフトウェアをテストしますか?
■ 文の整理
He is a Python developer.
→ 彼はPython開発者です。
He is not a Python developer.
→ 彼はPython開発者ではありません。
Is he a Python developer?
→ 彼はPython開発者ですか?
Isn’t he a Python developer?
→ 彼はPython開発者ではないのですか?
He writes Python scripts.
→ 彼はPythonスクリプトを書く。
He doesn’t write Python scripts.
→ 彼はPythonスクリプトを書かない。
Does he write Python scripts?
→ 彼はPythonスクリプトを書きますか?
Doesn’t he write Python scripts?
→ 彼はPythonスクリプトを書かないのですか?
第3章 基本5文型
自動詞と他動詞
• 自動詞:目的語を取らなくても文が成立する動詞。
例:「Alice codes.」= アリスはコーディングする。
→ 「何を」書くか言わなくても「コードを書く」という動作は成立。
• 他動詞:目的語がないと文が成立しない動詞。
例:「Alice uses NumPy.」= アリスはNumPyを使う。
→ 「何を使うか」が必要。
⸻
【第1文型】 S + V
主語(S)と動詞(V)だけで意味が通じる文。
Pythonエンジニアの日常では、作業動作を表すのに使える。
Alice codes.
→ アリスはコードを書く。
Bob debugs.
→ ボブはデバッグする。
👉 「誰が」「どうする」だけで完結。
⸻
【第2文型】 S + V + C
補語(C)が主語(S)を説明する文。
be動詞や「become, look, seem」などを使う。
S = C の関係になる。
Alice is a data scientist.
→ アリス = データサイエンティスト。
Bob looks busy.
→ ボブ = 忙しそう。
👉 「主語がどんな状態か」「何であるか」を表す。
⸻
【第3文型】 S + V + O
動詞のあとに目的語(O)をとる文。
他動詞が必要。Pythonライブラリを使う場面にぴったり。
Alice uses NumPy.
→ アリスはNumPyを使う。
Bob installs Pandas.
→ ボブはPandasをインストールする。
👉 「誰が」「何をする(操作する)」という構造。
⸻
【第4文型】 S + V + O1 + O2
動詞のあとに2つの目的語(O1: 人, O2: モノ)をとる文。
「〜に〜を」というニュアンス。
Alice gave Bob a Jupyter notebook.
→ アリスはボブにJupyterノートブックを渡した。
Bob showed Alice a Matplotlib plot.
→ ボブはアリスにMatplotlibのグラフを見せた。
👉 「人に物を与える・見せる」動作に使う。
⸻
【第5文型】 S + V + O + C
目的語(O)と補語(C)がイコール関係になる文。
「OをCにする」「OをCと呼ぶ」のように使う。
Alice made the model accurate.
→ アリスはモデルを正確にした。
Bob named the variable result.
→ ボブは変数を result と名づけた。
👉 「誰が」「何を」「どうしたか」を細かく説明。
⸻
冠詞と前置詞
• 冠詞 (a, the)
• a = 「1つの」「ある〜」
• the = 「その」「特定の」
Alice imported a library.
→ アリスは(ある)ライブラリをインポートした。
Bob imported the NumPy module.
→ ボブは(特定の)NumPyモジュールをインポートした。
• 前置詞 (in, on, to など)
名詞と組み合わせて場所・方法を表す。
Alice wrote code in the notebook.
→ アリスはノートブックの中でコードを書いた。
Bob saved the figure on the server.
→ ボブはサーバーにグラフを保存した。
⸻
文の主要素(Pythonエンジニア版)
• S (主語): Alice, Bob, The engineer
• V (動詞): codes, installs, shows
• O (目的語): NumPy, Pandas, a notebook
• C (補語): a data scientist, busy, accurate
• M (修飾語): in the notebook, on the server
⸻
こうして「文型」を意識すると、
英語の文の組み立てが プログラムの文法構造 と同じように見えてきます。
第4章 第1講 時制①
英語は動詞の形を変えて、「現在」「過去」「未来」のいつの話なのかを明確に伝える言葉。
例:
He is happy.(彼は幸せです)→ 現在
He was happy.(彼は幸せだった)→ 過去
動詞の形を変えて、時間(=時制)を表す。
⸻
■ 現在形
・急激な変化が起こらない事実や、過去から未来にまたがる事柄を表す。
例文1
NumPy is a library for arrays.
→ NumPyは配列のためのライブラリです。
例文2
She uses pandas every day.
→ 彼女は毎日pandasを使う。
例文3
I have a virtualenv.
→ 私は仮想環境を持っている。
⸻
■ 過去形
・動詞を過去形にして、今より前の出来事を表す。
例文4
He installed matplotlib yesterday.
→ 彼は昨日matplotlibをインストールした。
例文5
She was a Django developer.
→ 彼女はDjango開発者だった。
⸻
■ 大過去(過去完了)
・「had + 過去分詞」で表す。過去よりさらに前を表す。
例文6
He said that he had used TensorFlow before.
→ 彼は以前TensorFlowを使ったことがあると言った。
⸻
■ 未来
・「will + 動詞の原形」または「be going to + 動詞の原形」で表す。
例文7
I will deploy with FastAPI next year.
→ 私は来年FastAPIでデプロイするだろう。
例文8
She is going to learn PyTorch tomorrow.
→ 彼女は明日PyTorchを学ぶ予定だ。
⸻
■ 進行形
・「be動詞 + Ving」で「〜しているところ」を表す。
例文9
He is debugging NumPy now.
→ 彼はいまNumPyをデバッグしているところだ。
例文10
We are refactoring pandas code now.
→ 私たちはいまpandasのコードをリファクタリングしているところだ。
⸻
・現在形と進行形の違い
現在形:習慣や事実
例文11
They use scikit-learn every week.
→ 彼らは毎週scikit-learnを使う。
進行形:今この瞬間の動作
例文12
They are training a model with scikit-learn now.
→ 彼らはいまscikit-learnでモデルを学習している。
⸻
■ 注意:進行形にできない動詞(状態動詞)
have(持っている), know(知っている), believe(信じる), love(好む)などは通常進行形にしない。
ただし、口語では一時的な状態を表すときに使うことがある。
【通常は進行形にしない用法】
1. I have enough GPUs for training.
▶ 学習に十分なGPUを持っている。
2. She knows the architecture of transformers very well.
▶ 彼女はトランスフォーマーの構造をよく知っている。
3. We believe this model will outperform the baseline.
▶ このモデルがベースラインを上回ると信じている。
4. They love working with PyTorch.
▶ 彼らはPyTorchで作業するのが大好きだ。
⸻
【口語で一時的な状態を表す進行形用法】
5. I’m having some trouble with the loss function today.
▶ 今日、損失関数でちょっと問題を抱えている。
6. She is knowing the system better after debugging all day.
▶ 彼女は一日中デバッグして、このシステムをだんだん理解しつつある。
7. We are believing the accuracy numbers more after re-running the experiments.
▶ 実験をやり直して、その精度の数値をようやく信じ始めている。
8. I’m loving how fast this new GPU cluster is.
▶ この新しいGPUクラスタの速さ、すごく気に入ってるよ。
例文13
She loves Jupyter Notebook.
→ 彼女はJupyter Notebookが好きだ。
例文14(例外:口語)
I am loving this PyTorch tutorial!
→ 今、このPyTorchチュートリアルが最高に楽しい!
第5章 時制②:完了
【完了形の種類】
・現在完了:have[has] + 過去分詞
・過去完了:had + 過去分詞
・未来完了:will have + 過去分詞
※ have は「持っている」ではなく、助動詞として完了形を作る働きをする。
⸻
【現在完了の3つの意味】
① 継続:ずっと V している
例文1
She has run a Docker container since 2017.
→ 彼女は2017年からずっとDockerコンテナを実行している。
② 経験:今までに V したことがある
例文2
I have built an image with Dockerfile before.
→ 私は以前Dockerfileでイメージをビルドしたことがある。
③ 完了・結果:ちょうど V したところだ / すでに V してしまった
例文3
He has already pushed the image to Docker Hub.
→ 彼はすでにDocker Hubにイメージをプッシュしてしまった。
⸻
【現在完了の否定文】
・形:S + have[has] + not + 過去分詞
・短縮:haven’t / hasn’t + 過去分詞
・never を使うと「一度も〜ない」
例文4
I have never pulled a private image.
→ 私は一度もプライベートイメージをプルしたことがない。
・already → not … yet に変える
例文5
She has not deployed the container yet.
→ 彼女はまだコンテナをデプロイしていない。
⸻
【現在完了の疑問文】
・形:Have[Has] + S + 過去分詞 … ?
・答え方:Yes, S have/has. / No, S haven’t/hasn’t.
・ever を加えると「今までに〜したことがありますか?」
例文6
Have you ever used docker-compose in production?
→ あなたは今までに本番環境でdocker-composeを使ったことがありますか?
⸻
【過去完了の意味】
・形:had + 過去分詞
・意味:
① 継続:(過去のある時点までずっと)Vしていた
② 経験:(過去のある時点までに)Vしたことがあった
③ 完了:(過去のある時点に)Vし終わっていた
例文7
He had maintained a Docker swarm for many years before Kubernetes appeared.
→ 彼はKubernetesが登場する前、何年もDocker Swarmを管理していた。
例文8
They had pulled many base images by that time.
→ 彼らはそのときまでに多くのベースイメージをプルしていた。
⸻
【未来完了の意味】
・形:will have + 過去分詞
・意味:
① 継続:(未来のある時点までずっと)Vしているだろう
② 経験:(未来のある時点までに)Vしたことになるだろう
③ 完了:(未来のある時点に)Vし終わっているだろう
例文9
I will have run 100 containers if I launch 10 more.
→ あと10個立ち上げれば、100個のコンテナを実行したことになるだろう。
例文10
She will have managed Docker for 10 years by 2030.
→ 彼女は2030年までにDockerを10年間運用していることになるだろう。
例文11
The image will have been pushed to the registry by tomorrow.
→ そのイメージは明日までにはレジストリにプッシュされているだろう。
第6章 助動詞① ~助動詞&助動詞が入った文の形~
(Python と Excel VBA 用語版)
⸻
【助動詞の役割】
・動詞の前にくっつき、文に意味を付け加える
・「未来」「可能」「義務」「推量」「許可」などを表す
・助動詞の後ろの動詞は必ず「原形」
【助動詞の文の形】
●肯定文:S + 助動詞 + V
●否定文:S + 助動詞 + not + V
●疑問文:助動詞 + S + V … ?
⸻
【can / could】
① 能力・可能
例文1
Python can import NumPy.
→ PythonはNumPyをインポートできる。
② 可能性
例文2
That VBA macro cannot be safe.
→ そのVBAマクロは安全なはずがない。
③ 許可
例文3
Can I run this Python script?
→ このPythonスクリプトを実行してもいいですか?
④ 丁寧・弱い可能性
例文4
Could you debug this Excel VBA code?
→ このExcel VBAコードをデバッグしていただけますか?
⸻
【may / might】
① 許可
例文5
You may save the Excel file now.
→ 今Excelファイルを保存してよい。
② 推量
例文6
The Python process may be running in the background.
→ Pythonプロセスがバックグラウンドで動作しているかもしれない。
③ 弱い推量
例文7
It might crash if the VBA loop is infinite.
→ VBAループが無限ならクラッシュするかもしれない。
⸻
【must】
① 義務
例文8
Developers must test Python functions before deployment.
→ 開発者はデプロイ前にPython関数をテストしなければならない。
② 推量
例文9
This Excel sheet must be corrupted after the error.
→ このExcelシートはエラー後に破損したに違いない。
③ 禁止
例文10
You must not delete this Python virtual environment.
→ このPython仮想環境を削除してはならない。
⸻
【should】
例文11
The VBA code should handle errors properly.
→ VBAコードは適切にエラーを処理すべきだ。
⸻
【助動詞の書きかえ】
・will = be going to
例文12
Python will execute tomorrow. = Python is going to execute tomorrow.
→ Pythonは明日実行される予定だ。
・can = be able to
例文13
VBA can call a Python script. = VBA is able to call a Python script.
→ VBAはPythonスクリプトを呼び出すことができる。
・must = have to
例文14
You must update the Excel add-in. = You have to update the Excel add-in.
→ Excelアドインを更新しなければならない。
・must not ≠ don’t have to
例文15
You must not close the Python IDE.(閉じてはいけない=禁止)
You don’t have to close the Python IDE.(閉じる必要はない=義務なし)
⸻
【shall の表現】
例文16
Shall I format the Excel sheet for you?
→ Excelシートを整形しましょうか?
例文17
Shall we optimize this Python loop?
→ このPythonループを最適化しませんか?
⸻
【will / would / could を用いた依頼表現】
例文18
Would you run this Excel macro for me?
→ このExcelマクロを実行していただけませんか?
⸻
【would の表現】
例文19
I would like to automate Excel with Python.
→ 私はPythonでExcelを自動化したいのです。
例文20
I’d like to create a VBA function for this sheet.
→ このシート用にVBA関数を作りたいのです。
⸻
第7章 助動詞② ~慣用的な助動詞表現~
⸻
【1. had better】
・You had better V :Vした方がよい
・You had better not V :Vしない方がよい
例文1
You had better tune your hyperparameters carefully.
→ ハイパーパラメータを慎重に調整した方がいい。
例文2
You had better not deploy the model without validation.
→ 検証せずにモデルをデプロイしない方がいい。
⸻
【2. had best】
・You had best V :Vするのが一番よい
・You had best not V :Vしないのが一番よい
例文3
You had best use cross-validation before publishing results.
→ 結果を公表する前にクロスバリデーションを使うのが一番よい。
例文4
You had best not ignore data leakage issues.
→ データリークの問題を無視しないのが一番よい。
⸻
【3. ought to】
・ought to V :Vすべきだ = should
・ought not to V :Vすべきではない
例文5
We ought to monitor the model drift in production.
→ 本番環境でモデルドリフトを監視すべきだ。
例文6
You ought not to overfit the training dataset.
→ 訓練データに過学習すべきではない。
⸻
【4. used to】
・used to V :かつてはよくVした
・used to be … :かつては…だった
例文7
We used to train models only on CPUs.
→ 以前はCPUだけでモデルを訓練していた。
例文8
There used to be many feature-engineered models before deep learning.
→ ディープラーニング以前は特徴量エンジニアリング主体のモデルが多かった。
⸻
【5. may / might as well】
・…するくらいならVした方がましだ
例文9
You might as well use a pretrained model as build one from scratch.
→ 一から作るくらいなら事前学習済みモデルを使った方がましだ。
⸻
【6. may / might well】
・Vするのももっともだ
例文10
You may well be surprised at the performance boost from fine-tuning.
→ ファインチューニングによる性能向上に驚くのももっともだ。
⸻
【7. would rather】
・would rather V1 than V2 :V2するよりV1したい
・would rather not V :むしろVしたくない
例文11
I would rather use PyTorch than TensorFlow.
→ TensorFlowを使うよりPyTorchを使いたい。
例文12
I would rather not label thousands of images manually.
→ 何千枚もの画像を手作業でラベル付けしたくない。
⸻
【8. 紛らわしい used to】
① be used to V :Vするために使われる
② be used to Ving :Vするのに慣れている
例文13
This GPU is used to train large language models.
→ このGPUは大規模言語モデルを訓練するために使われる。
例文14
I am used to debugging distributed training jobs.
→ 分散学習ジョブのデバッグに慣れている。
⸻
【9. 過去の出来事を後悔する表現】
・need not have Vpp :Vする必要はなかったのに
・should have Vpp :Vすべきだったのに
例文15
You need not have used so many epochs for convergence.
→ 収束にそんなに多くのエポックを使う必要はなかったのに。
例文16
You should have normalized the input features.
→ 入力特徴量を正規化すべきだったのに。
⸻
【10. 過去の出来事を推察する表現】
・may / might have Vpp :Vしたかもしれない
・must have Vpp :Vしたに違いない
・cannot have Vpp :Vしたはずがない
例文17
The model may have failed due to vanishing gradients.
→ 勾配消失のせいでモデルが失敗したのかもしれない。
例文18
She must have optimized the learning rate schedule well.
→ 彼女は学習率スケジュールをうまく最適化したに違いない。
例文19
They cannot have trained this transformer without multiple GPUs.
→ 彼らが複数GPUなしでこのトランスフォーマーを訓練したはずがない。
第8章 受動態
~受動態の作り方とポイント~
⸻
【1. 受動態とは】
• 能動態:A が B を Vする → Active Voice
• 受動態:B が A に Vされる → Passive Voice
• 形:be + 過去分詞(Vpp)
例:
能動態:The engineer fine-tunes the model.
→ エンジニアがモデルをファインチューニングする。
受動態:The model is fine-tuned by the engineer.
→ モデルはエンジニアにファインチューニングされる。
⸻
【2. 受動態の作り方 3ステップ】
① 能動態の目的語(O)を受動態の主語(S)にする
② 動詞を「be + 過去分詞」にする
③ 行為者は「by + 主語」で表す(省略も可)
⸻
【3. 文型と受動態】
• 第1文型 (SV)、第2文型 (SVC) → Oがないので受動態にできない
• 第3文型 (SVO)、第4文型 (SVOO)、第5文型 (SVOC) → Oを主語にして受動態を作れる
⸻
【4. 第3文型の受動態】
能動態:The researcher trained the large language model.
受動態:The large language model was trained by the researcher.
→ 大規模言語モデルは研究者に訓練された。
能動態:They deploy LLM applications worldwide.
受動態:LLM applications are deployed worldwide.
→ LLMアプリケーションは世界中でデプロイされている。
⸻
【5. 第4文型の受動態】
能動態:The mentor gave the student a dataset.
受動態①:The student was given a dataset by the mentor.
→ 学生はメンターにデータセットを与えられた。
受動態②:A dataset was given to the student by the mentor.
→ データセットはメンターによって学生に与えられた。
⸻
【6. 第5文型の受動態】
能動態:The engineer called the model “GPT-X”.
受動態:The model was called “GPT-X” by the engineer.
→ そのモデルはエンジニアに「GPT-X」と呼ばれた。
⸻
【7. 群動詞の受動態】
能動態:The reviewers laughed at the poor prompt.
受動態:The poor prompt was laughed at by the reviewers.
→ その拙いプロンプトはレビュー担当者に笑われた。
能動態:The developer took care of the inference pipeline.
受動態:The inference pipeline was taken care of by the developer.
→ 推論パイプラインは開発者に管理された。
⸻
【8. by 以外の前置詞を使う受動態】
能動態:Everyone uses transformers.
受動態:Transformers are known to everyone.
→ トランスフォーマーは誰もが知っている。
よく使う形:
• be covered with ~
The paper is covered with benchmark results.
(その論文はベンチマーク結果で埋め尽くされている)
• be interested in ~
The researcher is interested in multimodal LLMs.
(研究者はマルチモーダルLLMに興味がある)
• be made from / of ~
Embeddings are made from token vectors.
(埋め込みはトークンベクトルから作られている)
• be surprised at ~
The engineer was surprised at the zero-shot performance.
(エンジニアはゼロショット性能に驚いた)
⸻
第9章 疑問詞と疑問文 ~疑問詞を使った疑問文~
【1. 疑問詞の種類】
• 疑問代名詞:who(誰)、what(何)、which(どちら)
• 疑問形容詞:whose(誰の)、which(どの)、what(どんな)
• 疑問副詞:when(いつ)、where(どこで)、why(なぜ)、how(どうやって)
⸻
【2. 基本の疑問文復習】
Alice trains a model.
→ Does Alice train a model?
Yes, she does. / No, she doesn’t.
⸻
【3. 疑問代名詞を使った疑問文】
例:Bob fine-tunes a model.
① 目的語が不明
Who does Bob fine-tune?
→ ボブは誰を(どのモデルを)ファインチューニングしますか?
② 主語が不明
Who fine-tunes the model?
→ 誰がそのモデルをファインチューニングしますか?
③ 物が不明
What do you have in your dataset?
→ 君のデータセットには何がありますか?
⸻
【4. 疑問形容詞を使った疑問文】
例:Clara can use this optimizer.
→ Which optimizer can Clara use?
→ クララはどのオプティマイザを使えますか?
例:David likes red.
→ What activation function does David like?
→ デイビッドはどんな活性化関数が好きですか?
⸻
【5. 疑問副詞を使った疑問文】
例:Emma trained the model last night.
→ When did Emma train the model?
→ エマは昨晩いつモデルを学習しましたか?
例:Frank bought the GPU for 200,000 yen.
→ How much did Frank buy the GPU for?
→ フランクはそのGPUをいくらで買いましたか?
how:方法(どうやって)
• How do you preprocess the data?(どうやってデータを前処理しますか?)
how high:精度をたずねる
• How high is the model accuracy?(モデルの精度はどれくらい高いですか?)
how long:時間をたずねる
• How long does training take?(学習にどれくらい時間がかかりますか?)
how many:数をたずねる
• How many layers are in the network?(ネットワークにはいくつの層がありますか?)
how old:年齢をたずねる
• How old is this dataset?(このデータセットはいつのものですか?)
how far:距離をたずねる
• How far can the model generalize?(モデルはどの程度汎化できますか?)
how large:大きさをたずねる
• How large is the dataset?(データセットはどれくらい大きいですか?)
how tall:背丈をたずねる → 工学的には「高さ」
• How tall is the input image?(入力画像の高さはいくつですか?)
how much:量・金額をたずねる
• How much memory does the model need?(モデルはどれくらいメモリを必要としますか?)
⸻
【6. 間接疑問文】
What does Alice want?
→ I don’t know what Alice wants.
→ 私はアリスが何を欲しがっているのか知らない。
Where does Bob train the model?
→ I don’t know where Bob trains the model.
→ 私はボブがどこでモデルを学習させているのか知らない。
Why is this model so accurate?
→ Please tell me why this model is so accurate.
→ なぜこのモデルがそんなに高精度なのか教えてください。
※ 間接疑問文では「疑問詞の後ろは普通の文の語順」になる。
※ 「Do you know ~?」などの大きな文が疑問形の場合は文末に「?」をつける。
⸻
第10章 命令文・感嘆文 ~画像処理エンジニアの日常~
【命令文】
・主語 you を省略し、動詞の原形から始める。画像処理の作業指示やコマンドの形に近い。
例文(命令文)
Apply the filter.
▶ フィルタを適用しなさい。
Resize the image.
▶ 画像をリサイズしなさい。
【否定命令文】
Don’t + 動詞の原形。誤処理を防ぐための注意としてよく使われる。
例文(否定命令文)
Don’t overwrite the original image.
▶ 元画像を上書きしてはいけない。
Don’t forget to normalize the data.
▶ データを正規化するのを忘れてはいけない。
【命令文 + and/or】
・(命令文), and … : 〜しなさい、そうすれば…(良い結果)
・(命令文), or … : 〜しなさい、さもないと…(悪い結果)
例文
Save your preprocessing steps, and you can reproduce the experiment.
▶ 前処理手順を保存しなさい、そうすれば実験を再現できる。
Use the wrong color space, or the detection will fail.
▶ 間違った色空間を使いなさい、さもないと検出は失敗する。
⸻
【感嘆文】
・驚きや感情を強調して表す文。画像処理エンジニアなら「性能」や「結果」に感嘆する場面が多い。
形
How + 形容詞/副詞 (+ SV)!
What a[an] + 形容詞 + 名詞 (+ SV)!
例文(感嘆文)
How sharp this edge detection is!
▶ このエッジ検出はなんて鮮明なんだ!
What an impressive segmentation result!
▶ なんて見事なセグメンテーション結果なんだ!
How fast the GPU runs the convolution!
▶ GPUがなんて速く畳み込みを処理するんだ!
⸻
第11章 不定詞① ~不定詞の名詞的用法~
【不定詞とは】
to + 動詞の原形の形をとり、名詞・形容詞・副詞のカタマリを作る。
不定詞 = to V
【名詞的用法】
to V が名詞のカタマリとなり、S・O・C になる。
例文(名詞的用法)
To detect faces is important.
▶ 顔を検出することは重要だ。(to detect faces が S のカタマリ)
It is wrong to mislabel images.
▶ 画像に誤ラベルを付けることはよくない。(形式主語 it を使った形)
She likes to preprocess datasets.
▶ 彼女はデータセットを前処理することが好きだ。(to preprocess datasets が O のカタマリ)
My task is to classify medical images.
▶ 私の仕事は医療画像を分類することです。(to classify medical images が C のカタマリ)
⸻
【意味上の主語】
不定詞に「誰が」Vするのかを示したいとき、for + 人 を置く。
例文
It is useful for beginners to learn OpenCV.
▶ 初心者がOpenCVを学ぶことは有益だ。
It is necessary for engineers to annotate data correctly.
▶ エンジニアがデータを正しくアノテーションすることは必要だ。
⸻
第12章 不定詞②
【形容詞的用法】
不定詞 to V が名詞を修飾する。MLエンジニアなら「タスク」「データ」「モデル」を説明する場面でよく使う。
例文1
We need data to train the model.
▶ モデルを訓練するためのデータが必要だ。
例文2
I have something to debug in the pipeline today.
▶ 今日パイプラインでデバッグすることがある。
例文3
They made a plan to deploy the system next month.
▶ 彼らは来月システムをデプロイする計画を立てた。
【注意:自動詞のとき】
前置詞を残す必要がある。
例文4
I have no cluster to run on.
▶ 実行するクラスタがない。(run は自動詞なので on が必要)
例文5
This is a dataset to work with.
▶ これは扱うためのデータセットだ。
例文6
That is a framework to rely on.
▶ あれは頼るためのフレームワークだ。
【名詞と to V の関係は3種類】
① 名詞が S、to V が V の関係
(We need data to train the model.)
② 名詞が to V の目的語の関係
(I have something to debug.)
③ to V が名詞の具体的内容を説明
(They made a plan to deploy the system.)
⸻
【不定詞の完了形】
to have + 過去分詞 = 文の動詞より過去を表す。
例文7
The model seems to be overfitting.
▶ モデルは過学習しているように見える(今)。
例文8
The model seems to have overfitted before regularization.
▶ モデルは正則化の前に過学習していたように見える(過去)。
⸻
第13章 不定詞③ ~副詞的用法 & 原形不定詞~
【副詞的用法】
不定詞 to V が副詞のカタマリになり、目的・結果・条件を説明する。
① 目的
I worked hard to optimize the loss function.
▶ 損失関数を最適化するために一生懸命働いた。
② 感情の原因
I am happy to see the model converging.
▶ モデルが収束して嬉しい。
③ 判断の根拠
He must be crazy to deploy without testing.
▶ テストなしでデプロイするなんて彼は正気じゃない。
④ 結果
She grew up to be a great ML engineer.
▶ 彼女は成長して優れた機械学習エンジニアになった。
⑤ 程度
The dataset was large enough to train a transformer.
▶ そのデータセットはトランスフォーマーを学習させるのに十分大きかった。
⑥ 条件
To read this paper, you would think it was written by an expert.
▶ この論文を読めば、専門家が書いたと思うだろう。
⑦ 形容詞修飾
This dataset is too noisy to use.
▶ このデータセットはノイズが多すぎて使えない。
⸻
【不定詞の否定形】
not to V:「~しないように」
例文
Take care not to leak private data.
▶ 個人データを漏らさないように気をつけなさい。
⸻
【原形不定詞】
to を伴わない不定詞。使役動詞・知覚動詞と一緒に用いる。
◆使役動詞
make O V:強制する
have O V:依頼する
let O V:許可する
例文9
The manager let the intern run the training job.
▶ マネージャーは研修生に学習ジョブを実行させた。
◆知覚動詞
see O V:見る
hear O V:聞く
feel O V:感じる
例文10
I saw the model fail during evaluation.
▶ 評価中にモデルが失敗するのを見た。
【原形不定詞】
to を伴わない不定詞。使役動詞・知覚動詞 と一緒に用いる。
⸻
◆使役動詞
1. make O V(強制する)
The professor made the students implement a CNN from scratch.
▶ 教授は学生たちにゼロからCNNを実装させた。
2. have O V(依頼する)
We had the server team fix the GPU cluster issue.
▶ GPUクラスタの問題をサーバーチームに直してもらった。
3. let O V(許可する)
The manager let the intern run the training job.
▶ マネージャーは研修生に学習ジョブを実行させた。
⸻
◆知覚動詞
4. see O V(見る)
I saw the model fail during evaluation.
▶ 評価中にモデルが失敗するのを見た。
5. hear O V(聞く)
We heard the system generate strange outputs during inference.
▶ 推論中にシステムが奇妙な出力をするのを聞いた。
6. feel O V(感じる)
She felt the training process overfit after just a few epochs.
▶ 彼女は学習がわずか数エポックで過学習するのを感じ取った。
第14章 動名詞
【1. 動名詞とは】
・動詞に -ing をつけて名詞化したもの
・意味は「Vすること」
・名詞の働きをするので 主語 (S)・目的語 (O)・補語 (C) になれる
例文1
Training models is a lot of fun.
▶ モデルを訓練することはとても楽しい。(S のカタマリ)
例文2
Alice likes debugging neural networks.
▶ アリスはニューラルネットワークをデバッグすることが好きだ。(O のカタマリ)
例文3
My job is tuning hyperparameters.
▶ 私の仕事はハイパーパラメータを調整することだ。(C のカタマリ)
⸻
【2. 動名詞と不定詞の違い】
どちらも「Vすること」だが、使える場面が異なる。
● 前置詞の後ろ → 動名詞のみ可
例:Bob is good at optimizing models. (〇)
× Bob is good at to optimize models. (✕)
● 特定の動詞の後ろ → 動名詞のみ可
stop / finish / give up / admit / miss / avoid / postpone / practice など
例文4
We finished cleaning the dataset.
▶ 私たちはデータセットのクリーニングを終えた。
ゴロ:SFDEMEGAMAPP
(S = stop, F = finish, D = deny, E = enjoy, M = mind, E = escape, G = give up, A = avoid, M = miss, A = admit, P = postpone, P = practice)
【動名詞しか使えない動詞:SFDEMEGAMAPP】
1. stop
We stopped training the model at 100 epochs.
▶ 私たちは100エポックでモデルの学習を止めた。
2. finish
She finished cleaning the dataset.
▶ 彼女はデータセットのクリーニングを終えた。
3. deny
The engineer denied leaking the test labels.
▶ エンジニアはテストラベルを漏らしたことを否定した。
4. enjoy
They enjoy tuning hyperparameters late at night.
▶ 彼らは深夜にハイパーパラメータを調整するのを楽しんでいる。
5. mind
Do you mind me updating the repository now?
▶ 今私がリポジトリを更新するのを気にしますか?
6. escape
The model escaped overfitting by using dropout.
▶ モデルはドロップアウトを使って過学習を免れた。
7. give up
We gave up training the huge model on a single GPU.
▶ 私たちは巨大モデルを1枚のGPUで学習させるのを諦めた。
8. avoid
He avoided sharing the raw dataset for privacy reasons.
▶ 彼はプライバシー上の理由で生データセットを共有するのを避けた。
9. miss
I missed updating the learning rate schedule.
▶ 学習率スケジュールを更新するのを逃した。
10. admit
She admitted mislabeling some training data.
▶ 彼女は一部の学習データに誤ラベルを付けたことを認めた。
11. postpone
We postponed deploying the new model until the bug was fixed.
▶ バグが修正されるまで新モデルのデプロイを延期した。
12. practice
The interns practiced writing unit tests for the ML pipeline.
▶ 研修生たちはMLパイプラインのユニットテストを書く練習をした。
【3. 意味が変わる動詞】
動名詞 (Ving) と不定詞 (to V) で意味が変わる。
例文5
I remember deploying the model yesterday.
▶ 昨日モデルをデプロイしたのを覚えている。(過去のこと)
例文6
I remember to deploy the model tomorrow.
▶ 明日モデルをデプロイすることを覚えている。(未来のこと)
原則
・Ving = 過去にしたこと
・to V = 未来にすること
⸻
【4. 意味上の主語】
動名詞の前に 所有格 (my, his, Alice’s) を置く。
例文7
Do you mind my updating the repository?
▶ 私がリポジトリを更新することを気にしますか?
口語では目的格 (me, him, her) も可
Do you mind me updating the repository?
⸻
【5. 完了形動名詞】
having + 過去分詞 = 文の動詞が表す時より前の出来事。
例文8
He is proud of having published a paper on deep learning.
▶ 彼はディープラーニングの論文を発表したことを誇りに思っている。
⸻
【6. 否定形】
not + Ving
例文9
The team insisted on not using biased data.
▶ チームはバイアスのかかったデータを使わないことを主張した。
完了形の否定 → not having + 過去分詞
例文10
She is proud of not having failed the Kaggle competition.
▶ 彼女はKaggle大会で失敗しなかったことを誇りに思っている。
⸻
【7. 重要表現】
・It is no use Ving = Vしても無駄
It is no use training a model without data.
▶ データなしでモデルを訓練しても無駄だ。
・look forward to Ving = Vするのを楽しみにする
I look forward to presenting our research at NeurIPS.
▶ NeurIPSで研究を発表するのを楽しみにしている。
・There is no Ving = Vすることはできない
There is no predicting user behavior perfectly.
▶ ユーザー行動を完全に予測することはできない。
・on Ving = Vするとすぐに
On receiving the dataset, we started preprocessing.
▶ データセットを受け取るとすぐに前処理を始めた。
⸻
第15章 分詞① ~形容詞のカタマリを作る Ving と Vpp~
【1. 分詞とは】
・動詞を Ving(現在分詞) や Vpp(過去分詞) に変化させた形
・名詞を修飾(説明)して「形容詞のカタマリ」を作る
・動名詞(名詞のカタマリ)とは役割が違う(名詞になるのが動名詞、形容詞になるのが分詞)
⸻
【2. 名詞を前から修飾する分詞】
例文1
The running process is consuming too much memory.
▶ 実行中のプロセスがメモリを消費しすぎている。
(process が「実行している」→ Ving 使用)
例文2
The trained model is ready for deployment.
▶ 訓練されたモデルはデプロイの準備ができている。
(model が「訓練される」→ Vpp 使用)
原則
・名詞が Vする[している] → Ving
・名詞が Vされる[された] → Vpp
⸻
【3. 名詞を後ろから修飾する分詞】
例文3
The datasets stored in the cloud are huge.
▶ クラウドに保存されたデータセットは巨大だ。
(datasets が「保存されている」→ Vpp)
例文4
Check the logs generated by the training script.
▶ 訓練スクリプトによって生成されたログを確認しなさい。
(logs が「生成される」→ Vpp)
⸻
【4. 不定詞との違い】
・名詞 + Ving → 「進行中・今起きている感じ」
・名詞 + to V → 「未来的・これからの感じ」
例
a running experiment = 実行中の実験
an experiment to run = これから実行する実験
⸻
【5. 分詞の位置ルール】
・1語 → 名詞の前に置く
・2語以上のカタマリ → 名詞の後ろに置く
⸻
【まとめ】
・分詞は形容詞のカタマリを作り、名詞を説明する
・Ving か Vpp かは「名詞がVするのか/されるのか」で決まる
・不定詞と分詞では「未来的か現在進行的か」の違いがある
⸻
第16章 分詞② ~補語(C)になる Ving と Vpp~
【1. 分詞は補語にもなれる】
補語(C = Complement)は、主語や目的語を説明して意味を補う語。
分詞は形容詞の働きをするので、SVC や SVOC の文で使える。
⸻
【2. SVC の C に分詞】
例文1
The server is running.
▶ サーバーは稼働している。(server = running → Ving)
例文2
The model looks overfitted.
▶ そのモデルは過学習しているように見える。(model = overfitted → Vpp)
原則
・S が Cする[している] → Ving
・S が Cされる[された] → Vpp
⸻
【3. SVOC の C に分詞】
例文3
I saw the GPU running.
▶ 私はGPUが動いているのを見た。 (GPU = running → Ving)
例文4
The engineer heard his code reviewed by the team.
▶ そのエンジニアはコードがチームにレビューされるのを聞いた。 (code = reviewed → Vpp)
※ SVOC では see / hear / feel などの「知覚動詞」がよく使われる。
⸻
【4. with O C(付帯状況の with)】
例文5
She trained the model with the GPU running.
▶ 彼女はGPUを動かしながらモデルを訓練した。 (GPU = running → Ving)
例文6
He left the meeting with the issue unresolved.
▶ 彼は課題を未解決のまま会議を終えた。 (issue = unresolved → Vpp)
⸻
【5. 分詞を使った慣用表現】
・keep (on) Ving = Vし続ける
The system keeps learning from new data.
▶ システムは新しいデータから学び続ける。
・be busy Ving = 忙しくVしている
Alice is busy debugging the model.
▶ アリスはモデルのデバッグで忙しい。
・spend 時間 Ving = Vして時間を過ごす
We spent hours tuning the hyperparameters.
▶ 私たちはハイパーパラメータ調整に数時間を費やした。
・make oneself understood = 理解してもらう
The researcher made himself understood at the conference.
▶ 研究者は学会で自分の考えを理解してもらった。
⸻
【まとめ】
・分詞は補語として SVC / SVOC の文で使える
・S[O]とCの関係を見て Ving か Vpp を選ぶ
・with O C で「付帯状況」を表現できる
・慣用表現では Ving が頻出(keep Ving, be busy Ving など)
⸻
第17章 分詞構文①
~副詞のカタマリを作る Ving と Vpp~
【1. 分詞構文とは】
・分詞が副詞のカタマリを作り、文全体に意味を添える用法
・接続詞(as, when, if, though など)を省き、動詞を分詞に変えることで成立
例:
As the server was running, we couldn’t deploy new code.
= Being running, the server couldn’t accept new code.
▶ サーバーが稼働していたので、新しいコードをデプロイできなかった。
⸻
【2. 分詞構文の作り方】
① 副詞節の接続詞を省略
② 節の動詞を Ving または Vpp にする
③ 主語が外と同じなら省略、違えば残す
④ 時制が違うときは having + 過去分詞
⸻
【3. 分詞構文の意味(6パターン)】
① 理由:
Because the script was failing, we stopped the test.
= Failing, we stopped the test.
▶ スクリプトが失敗していたので、テストを中止した。
② 時:
When he was coding, he forgot the meeting.
= Coding, he forgot the meeting.
▶ コードを書いているとき、彼は会議を忘れた。
③ 条件:
If optimized, the function runs faster.
= Optimized, the function runs faster.
▶ 最適化されれば、その関数は速く動く。
④ 譲歩:
Though running the program, he didn’t get correct output.
= Running the program, he didn’t get correct output.
▶ プログラムを走らせたけれど、正しい出力は得られなかった。
⑤ 結果:
He forgot to close the file, and it caused an error.
= Forgetting to close the file, he caused an error.
▶ ファイルを閉じ忘れて、エラーを起こした。
⑥ 付帯状況:
He explained the code as he was debugging it.
= Explaining the code, he was debugging it.
▶ コードを説明しながらデバッグしていた。
⸻
【4. 主語が同じ/違う場合】
例文1(主語同じ)
As the program was too slow, we refactored it.
= Being too slow, the program was refactored.
例文2(主語違う)
As the server was down, we couldn’t push code.
= The server being down, we couldn’t push code.
▶ サーバーが落ちていたので、コードをプッシュできなかった。
⸻
【5. 時制が違う場合 → having + 過去分詞】
例文3(S同じ, 時制違う)
After she had fixed the bug, she deployed the system.
= Having fixed the bug, she deployed the system.
例文4(S違う, 時制違う)
As the test had failed, we rolled back the release.
= The test having failed, we rolled back the release.
⸻
第18章 分詞構文②
~副詞のカタマリを作る Ving と Vpp②~
【1. 過去分詞で副詞のカタマリを作る】
受動態のとき、Vpp が分詞構文を作る。
例文1
As the code was written in Python, it was easy to maintain.
= Written in Python, the code was easy to maintain.
▶ Pythonで書かれていたので、そのコードは保守しやすかった。
⸻
【2. 分詞構文の否定形】
例文2
Because I didn’t check the log, I couldn’t find the error.
= Not checking the log, I couldn’t find the error.
▶ ログを確認しなかったので、エラーを見つけられなかった。
⸻
【3. 分詞構文の慣用表現】
• generally speaking = 一般的に言えば
• strictly speaking = 厳密に言えば
• frankly speaking = 率直に言えば
• judging from ~ = ~から判断すると
• considering ~ = ~を考慮すると
generally speaking = 一般的に言えば
Generally speaking, deep learning models need large datasets.
▶ 一般的に言えば、ディープラーニングモデルには大規模データセットが必要だ。
2. strictly speaking = 厳密に言えば
Strictly speaking, accuracy is not a good metric for imbalanced datasets.
▶ 厳密に言えば、精度は不均衡データセットに適した指標ではない。
3. frankly speaking = 率直に言えば
Frankly speaking, this baseline model will not beat GPT-level performance.
▶ 率直に言えば、このベースラインモデルがGPTレベルの性能に勝つことはないだろう。
4. judging from ~ = ~から判断すると
Judging from the learning curve, the model is overfitting after 20 epochs.
▶ 学習曲線から判断すると、そのモデルは20エポック以降に過学習している。
5. considering ~ = ~を考慮すると
Considering the limited GPU memory, we should use gradient checkpointing.
▶ GPUメモリが限られていることを考慮すると、勾配チェックポイントを使うべきだ。
例文3
Generally speaking, Python is slower than C++.
▶ 一般的に言えば、PythonはC++より遅い。
例文4
Judging from the error message, the bug is in the API.
▶ エラーメッセージから判断すると、そのバグはAPIにある。
⸻
【4. 接続詞のまとめ】
(1) 副詞のカタマリを作る接続詞
As the build failed, we stopped the release.
(2) 名詞のカタマリを作る接続詞
I think that Python is easier than Java.
(3) 並列の接続詞
The code is clean and runs fast.
⸻
【まとめ】
• 分詞構文は Ving だけでなく Vpp も使える(特に受動態)
• 否定は Not + Ving / Vpp
• 慣用表現(speaking, judging, considering)は頻出
• 接続詞は「副詞用/名詞用/並列用」の3タイプ
第19章 関係代名詞①
~名詞を後ろから説明する文を作る~
【1. 関係代名詞とは】
名詞を後ろから説明するために使う語。
例文
I built a model that predicts images well.
= 私は画像をよく予測するモデルを作った。
⸻
【2. 関係代名詞の種類と役割】
(1) 主格
I know an engineer who works on reinforcement learning.
= 強化学習を研究しているエンジニアを知っている。
The dataset which is stored on Kaggle is public.
= Kaggleに保存されているデータセットは公開されている。
(2) 所有格
I know the researcher whose paper won the Best Paper Award.
= 論文が最優秀賞を取った研究者を知っている。
(3) 目的格
The engineer whom I met at NeurIPS explained the algorithm.
= NeurIPSで会ったエンジニアがアルゴリズムを説明した。
⸻
【3. 関係代名詞の整理】
主格: who / which / that
所有格: whose
目的格: whom / which / that
⸻
【CHECK問題】
(1) これは私が昨日トレーニングしたモデルです。
→ This is the model (which / that / 省略) I trained yesterday.
(2) あそこで動いているコードは私たちの実装です。
→ The code (which / that) is running there is ours.
(3) 彼は精度がとても高いモデルを持つエンジニアです。
→ He is the engineer whose model has very high accuracy.
⸻
第20章 関係代名詞②
~前置詞+関係代名詞・what~
【1. 前置詞+関係代名詞】
The dataset which we trained the model on is ImageNet.
= モデルを学習させたデータセットはImageNetです。
That is the repository to which the team contributes.
= あれがチームが貢献しているリポジトリです。
⸻
【2. 関係代名詞 what】
What the model predicted was correct.
= モデルが予測したことは正しかった。
Give me what you coded yesterday.
= 昨日書いたコードをください。
This is what the team implemented.
= これはチームが実装したものです。
Tell me what happened in the training process.
= 学習過程で起こったことを教えてください。
⸻
【3. what を使った慣用表現】
This is what is called transfer learning.
= これはいわゆる転移学習です。
What is worse, the model overfitted to the test data.
= さらに悪いことに、モデルはテストデータに過学習した。
⸻
【CHECK問題】
(1) 彼が開発したアルゴリズムを知っています。
→ I know the algorithm (which / that) he developed.
(2) 彼女が欲しいGPUを教えてください。
→ Tell me what GPU she wants.
(3) これは私が昨日提出した論文です。
→ This is the paper (which / that / 省略) I submitted yesterday.
(4) これはいわゆる教師なし学習です。
→ This is what is called unsupervised learning.
第21章 関係副詞
~where / when / why / how~
【1. 関係副詞とは】
関係副詞は「接続詞+副詞」の働きをして、名詞を後ろから説明する。
後ろは「完全な文」になる。
【4つの関係副詞】
① where:場所
② when:時
③ why:理由(the reason)
④ how:方法(the way)
⸻
【2. where】(場所を表すとき)
例文
This is the lab where we trained the neural network.
= ここが私たちがニューラルネットを学習させた研究室です。
(関係代名詞で言い換え → the lab which we trained the model in)
⸻
【3. when】(時を表すとき)
例文
2012 was the year when deep learning became popular.
= 2012年はディープラーニングが普及した年です。
(関係代名詞で言い換え → the year which deep learning became popular in)
⸻
【4. why】(理由を表すとき)
例文
Tell me the reason why the model overfitted.
= モデルが過学習した理由を教えてください。
(the reason を省略 → Tell me why the model overfitted.)
⸻
【5. how】(方法を表すとき)
例文
This is the way (how) we optimized the hyperparameters.
= これが私たちがハイパーパラメータを最適化した方法です。
(正しい省略 → This is how we optimized the hyperparameters.
または This is the way we optimized the hyperparameters.)
⸻
【CHECK問題】
(1) これは私が最初にTensorFlowを学んだ場所です。
→ This is the place ( ) I first learned TensorFlow.
答え: where
(2) これは私たちがモデルを公開した日です。
→ This is the day ( ) we released the model.
答え: when
(3) 彼がGPUを使った理由を知っていますか?
→ Do you know the reason ( ) he used a GPU?
答え: why
(4) これが私が特徴量を選択した方法です。
→ This is ( ) I selected the features.
答え: how / the way
⸻
第22章 比較①
~原級・比較級・負けパターン~
【1. 比較とは】
比較=どちらがより~かを比べること。
形容詞・副詞を対象にする。
結果は3パターン:
① 勝ち → Aの方が~
② 引き分け → 同じくらい~
③ 負け → Aの方が~でない
⸻
【2. 比較級の作り方】
● 短い形容詞・副詞 → -er / -est
● 長い形容詞・副詞 → more / most
● 不規則変化 → good → better, bad → worse, many → more
⸻
【3. 勝ちパターン(比較級+than)】
例文
This model is more accurate than the baseline.
= このモデルはベースラインより正確だ。
⸻
【4. 引き分けパターン(as ~ as)】
例文
Our CNN is as fast as the competitor’s model.
= 私たちのCNNは競合モデルと同じくらい速い。
⸻
【5. 負けパターン(less / not as ~ as)】
例文
This algorithm is less efficient than gradient descent.
= このアルゴリズムは勾配降下法ほど効率的ではない。
Our model is not as explainable as decision trees.
= 私たちのモデルは決定木ほど説明可能ではない。
⸻
【6. 比較級の強調】
例文
This version is much faster than the previous one.
= このバージョンは以前のものよりずっと速い。
⸻
【CHECK問題】
(1) このアルゴリズムは私が実装したものより正確です。
→ This algorithm is ( ) accurate than the one I implemented.
答え: more
(2) 私のモデルは彼のモデルと同じくらい効率的です。
→ My model is as ( ) as his.
答え: efficient
(3) この手法はランダムフォレストほど安定していません。
→ This method is not as ( ) as random forests.
答え: stable
(4) この最適化は以前よりずっと速いです。
→ This optimization is much ( ) than before.
答え: faster
~最上級+慣用表現~
【1. 最上級の基本】
最上級=「3つ以上の中で一番~」を表す。
例文1
Our model trains the fastest in the research team.
▶ 私たちのモデルは研究チームの中で一番速く学習する。
例文2
He debugged the hardest of all the engineers.
▶ 彼はエンジニア全員の中で一番熱心にデバッグした。
⸻
【2. 比較を使った慣用表現】
① 倍数表現
This GPU is twice as powerful as that one.
▶ このGPUはあのGPUの2倍の性能だ。
② as 原級 as possible (= as 原級 as S can)
We collected as many datasets as possible.
= We collected as many datasets as we could.
▶ 私たちはできるだけ多くのデータセットを集めた。
③ 比較級 and 比較級
The training is getting slower and slower.
▶ 学習がだんだん遅くなっている。
④ the 比較級 of the two
This optimizer is the better of the two.
▶ このオプティマイザは2つのうちで良い方だ。
⑤ The 比較級 S V, the 比較級 S V
The deeper the network is, the harder it is to interpret.
▶ ネットワークが深ければ深いほど、解釈は難しくなる。
⑥ like A better than B / prefer A to B
I like PyTorch better than TensorFlow.
= I prefer PyTorch to TensorFlow.
▶ 私はTensorFlowよりPyTorchの方が好きだ。
⑦ like A (the) best in / of 名詞
She likes NLP the best of all AI fields.
▶ 彼女はAI分野の中で自然言語処理が一番好きだ。
⑧ one of the 最上級+複数名詞
This is one of the most useful datasets in ML.
▶ これは機械学習で最も有用なデータセットの一つだ。
⑨ 比較級 than any other 単数名詞
This algorithm is faster than any other method.
▶ このアルゴリズムは他のどんな手法よりも速い。
⑩ No other ~ as 原級 as … / No other ~ 比較級 than …
No other framework is as popular as PyTorch.
= No other framework is more popular than PyTorch.
▶ PyTorchほど人気のあるフレームワークはない。
⸻
【CHECK問題】
(1) 彼はチームで一番優れたプログラマだ。
→ He is ( ) in the team.
答え: the best programmer
(2) 彼女はクラスの中で最も有望なエンジニアの一人だ。
→ She is one of ( ) engineers in her class.
答え: the most promising
(3) このアルゴリズムは他のどんなアルゴリズムよりも正確です。
→ This algorithm is ( ) any other algorithm.
答え: more accurate than
(4) モデルが大きければ大きいほど、推論は遅くなる。
→ ( ) the model is, ( ) the inference becomes.
答え: The larger / the slower
⸻
第24章 仮定法①
~仮定法の基本形~
【1. 仮定法とは】
仮定法は「現実には起きていないもしも話」をするときに使う。
→ 現在→過去形、過去→過去完了形。
⸻
【2. 現在のもしも話(仮定法過去)】
If S V過去, S’ would [could / might] V原形.
例文1
If I were a GPU, I could process data much faster.
▶ もし私がGPUだったら、もっと速くデータを処理できるのに。
⸻
【3. 過去のもしも話(仮定法過去完了)】
If S had Vpp, S’ would have Vpp.
例文2
If we had tuned the hyperparameters, the model would have performed better.
▶ もしハイパーパラメータを調整していたら、モデルはもっと良い性能を出していただろう。
⸻
【4. 未来のもしも話】
① If S were to V, S’ would V.
例文3
If the dataset were to be deleted, we would lose months of work.
▶ もしデータセットが消されたら、数か月の作業を失うだろう。
② If S should V, S’ would / will V.
例文4
If the server should crash, we will stop the training.
▶ 万が一サーバーが落ちたら、学習を止めるだろう。
⸻
【5. 混合仮定法】
If S had Vpp, S’ would V原形 … now.
例文5
If the engineer had fixed the bug, the system would be running now.
▶ もしエンジニアがバグを修正していたら、今システムは動いているだろう。
⸻
【6. 仮定法を使った慣用表現】
現在のもしも話
If it were not for GPUs, deep learning would be impossible.
= Were it not for GPUs
= But for GPUs
= Without GPUs
▶ もしGPUがなければ、ディープラーニングは不可能だ。
過去のもしも話
If it had not been for open-source libraries, our project would have failed.
▶ もしオープンソースライブラリがなかったなら、私たちのプロジェクトは失敗していただろう。
⸻
【CHECK問題】
(1) もし私がデータサイエンティストなら、この問題を解けるのに。
→ If I ( ) a data scientist, I ( ) solve this problem.
答え: were / could
(2) もし彼がもっと実験していたら、論文に採択されただろう。
→ If he ( ) more experiments, he ( ) have been accepted.
答え: had run / would
(3) 万が一電源が落ちたら、訓練は中止される。
→ If the power ( ) fail, training ( ) stop.
答え: should / will
(4) もし彼女が助けてくれなかったら、今システムは動いていないだろう。
→ If she ( ) me, the system ( ) not be running now.
答え: had not helped / would
(5) もしGPUがなければ、私たちのモデルは学習できない。
→ ( ) it not for GPUs, our model ( ) not train.
答え: Were / would
第25章 仮定法②
~wish / as if / It is time~
【1. I wish + 仮定法】
wish = 「現実に反する願望を表す」
時制を1つ過去にずらして仮定法を作る。
① 現在の願望 → 動詞を過去形に
例文1
I wish I were better at CUDA programming.
▶ CUDAプログラミングがもっと得意だったらなあ。
(現実:得意ではない)
② 過去への願望 → 動詞を過去完了形に
例文2
I wish we had backed up the dataset.
▶ データセットをバックアップしておけばよかったのに。
(現実:していなかった)
⸻
【2. as if + 仮定法】
as if = 「まるで~かのように」
as if の後ろの文だけ仮定法にする。
① 現在の「まるで」 → 動詞を過去形に
例文3
He explains the results as if he were the only author.
▶ 彼はまるで自分が唯一の著者であるかのように結果を説明する。
(現実:そうではない)
② 過去の「まるで」 → 動詞を過去完了形に
例文4
She spoke as if she had deployed the model herself.
▶ 彼女はまるで自分でモデルをデプロイしたかのように話した。
(現実:していない)
⸻
【3. It is time + 仮定法】
It is time S V過去. = 「Sはもう~してもいい頃だ」
例文5
It is time we finished optimizing the hyperparameters.
▶ そろそろハイパーパラメータの調整を終えてもいい頃だ。
(現実:まだ終えていない)
⸻
【CHECK問題】
(1) GPUクラスタを持っていればなあ。
→ I ( ) I ( ) a GPU cluster.
答え: wish / had
(2) もし論文を早く投稿していたらなあ。
→ I wish we ( ) the paper earlier.
答え: had submitted
(3) 彼はまるでディープラーニングを発明したかのように話す。
→ He talks as if he ( ) deep learning.
答え: had invented
(4) 彼女はまるで大規模データで訓練したかのように発表した。
→ She presented as if she ( ) the model on large-scale data.
答え: had trained
(5) もうコードレビューを始めてもいい頃だよ。
→ It is time you ( ) the code review.
答え: started
- 問題生成時は前置きや解説文は不要で、いきなり **Questions** から始める。
- プレーンテキスト形式でコピー&ペーストできる形にする。
---