コーヒー買ってきて☕
*私の投稿では KMNIST について説明しています。
KMNIST() は、以下に示すように KMNIST データセットを使用できます。
*メモ:
- 最初の引数は root(Required-Type:str または pathlib.Path) です。 *絶対パスまたは相対パスが可能です。
- 2 番目の引数は train(Optional-Default:True-Type:bool) です。 ※Trueの場合はトレーニングデータ(60,000枚)、Falseの場合はテストデータ(10,000枚)を使用します。
- 3 番目の引数は、transform(Optional-Default:None-Type:callable) です。
- 4 番目の引数は target_transform(Optional-Default:None-Type:callable) です。
- 5 番目の引数は download(Optional-Default:False-Type:bool) です。
*メモ:
- True の場合、データセットはインターネットからダウンロードされ、ルートに抽出 (解凍) されます。
- これが True で、データセットが既にダウンロードされている場合、データセットは抽出されます。
- これが True で、データセットがすでにダウンロードされ抽出されている場合は、何も起こりません。
- データセットがすでにダウンロードされ抽出されている場合は、その方が高速であるため、False にする必要があります。
- ここからデータセットを手動でダウンロードして抽出できます。データ/KMNIST/生/。
from torchvision.datasets import KMNIST train_data = KMNIST( root="data" ) train_data = KMNIST( root="data", train=True, transform=None, target_transform=None, download=False ) test_data = KMNIST( root="data", train=False ) len(train_data), len(test_data) # (60000, 10000) train_data # Dataset KMNIST # Number of datapoints: 60000 # Root location: data # Split: Train train_data.root # 'data' train_data.train # True print(train_data.transform) # None print(train_data.target_transform) # None train_data.download # <bound method mnist.download of dataset kmnist number datapoints: root location: data split: train> train_data[0] # (<pil.image.image image mode="L" size="28x28">, 8) train_data[1] # (<pil.image.image image mode="L" size="28x28">, 7) train_data[2] # (<pil.image.image image mode="L" size="28x28">, 0) train_data[3] # (<pil.image.image image mode="L" size="28x28">, 1) train_data[4] # (<pil.image.image image mode="L" size="28x28">, 4) train_data.classes # ['o', 'ki', 'su', 'tsu', 'na', 'ha', 'ma', 'ya', 're', 'wo'] </pil.image.image></pil.image.image></pil.image.image></pil.image.image></pil.image.image></bound>
from torchvision.datasets import KMNIST train_data = KMNIST( root="data", train=True ) test_data = KMNIST( root="data", train=False ) import matplotlib.pyplot as plt def show_images(data): plt.figure(figsize=(12, 2)) col = 5 for i, (image, label) in enumerate(data, 1): plt.subplot(1, col, i) plt.title(label) plt.imshow(image) if i == col: break plt.show() show_images(data=train_data) show_images(data=test_data)
以上がPyTorch の KMNISTの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

Arraysinpython、特にvianumpy、arecrucialinscientificComputing fortheirefficienty andversitility.1)彼らは、fornumericaloperations、data analysis、andmachinelearning.2)numpy'simplementation incensuresfasteroperationsthanpasteroperations.3)arayableminablecickick

Pyenv、Venv、およびAnacondaを使用して、さまざまなPythonバージョンを管理できます。 1)Pyenvを使用して、複数のPythonバージョンを管理します。Pyenvをインストールし、グローバルバージョンとローカルバージョンを設定します。 2)VENVを使用して仮想環境を作成して、プロジェクトの依存関係を分離します。 3)Anacondaを使用して、データサイエンスプロジェクトでPythonバージョンを管理します。 4)システムレベルのタスク用にシステムPythonを保持します。これらのツールと戦略を通じて、Pythonのさまざまなバージョンを効果的に管理して、プロジェクトのスムーズな実行を確保できます。

numpyarrayshaveveraladvantages-averstandardpythonarrays:1)thealmuchfasterduetocベースのインプレンテーション、2)アレモレメモリ効率、特にlargedatasets、および3)それらは、拡散化された、構造化された形成術科療法、

パフォーマンスに対する配列の均一性の影響は二重です。1)均一性により、コンパイラはメモリアクセスを最適化し、パフォーマンスを改善できます。 2)しかし、タイプの多様性を制限し、それが非効率につながる可能性があります。要するに、適切なデータ構造を選択することが重要です。

craftexecutablepythonscripts、次のようになります

numpyarraysarasarebetterfornumeroperations andmulti-dimensionaldata、whilethearraymoduleissuitable forbasic、1)numpyexcelsinperformance and forlargedatasentassandcomplexoperations.2)thearraymuremememory-effictientivearientfa

NumPyArraySareBetterforHeavyNumericalComputing、whilethearrayarayismoreSuitableformemory-constrainedprojectswithsimpledatatypes.1)numpyarraysofferarays andatiledance andpeperancedatasandatassandcomplexoperations.2)thearraymoduleisuleiseightweightandmemememe-ef

ctypesallowsinging andmanipulatingc-stylearraysinpython.1)usectypestointerfacewithclibrariesforperformance.2)createc-stylearraysfornumericalcomputations.3)passarraystocfunctions foreffientientoperations.how、how、becuutiousmorymanagemation、performanceo


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

WebStorm Mac版
便利なJavaScript開発ツール

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SAP NetWeaver Server Adapter for Eclipse
Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。

EditPlus 中国語クラック版
サイズが小さく、構文の強調表示、コード プロンプト機能はサポートされていません

Safe Exam Browser
Safe Exam Browser は、オンライン試験を安全に受験するための安全なブラウザ環境です。このソフトウェアは、あらゆるコンピュータを安全なワークステーションに変えます。あらゆるユーティリティへのアクセスを制御し、学生が無許可のリソースを使用するのを防ぎます。

ホットトピック









