警告:このプロジェクトは廃止されました。 Swift for TensorFlow は、機械学習、コンパイラー、微分可能プログラミング、システム設計などにわたる最新の研究を組み込んだ、機械学習用の次世代プラットフォームの実験でした。 2021年2月にアーカイブされました。
TensorVisitorPlan
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
public struct TensorVisitorPlan<Base>
TensorVisitorPlan は[WritableKeyPath<Base, Tensor<Float>]
を近似しますが、より効率的です。これは、勾配、既存の重み、補助的に保存された重みを見つけるために使用できるインデックスをマッピングする汎用オプティマイザーを作成する場合に便利です。これは若干効率的 (~2 倍) ですが、個々の KeyPath を追跡するために単純なリストで必要とされる O( Depth_of_tree) 作業を実行する必要がないため、わずかに高いオーバーヘッド (追加のポインタ逆参照) をトレードオフするため、より良い可能性があります。
計画を単一の[WritableKeyPath<Base, Tensor<Float>]
としてフラット化します。
宣言
public var allTensorKeyPaths: [WritableKeyPath<Base, Tensor<Float>>] { get }
宣言
public func allTensors(_ v: Base) -> [Tensor<Float>]
Base
型の 2 つの値を効率的にマッピングし、マッピング関数を適用します。テンソルの数を返します。追加のInt
引数は、プランと同じ Tensor カウントを持つ Tensor の補助リストへのインデックス付けを可能にするために提供されます。
宣言
@discardableResult
public func mapTensors(
_ v1: inout Base, _ v2: Base, _ fn: (inout Tensor<Float>, Tensor<Float>, Int) -> Void
) -> Int
宣言
func populateMask<Base>(_ mask: inout [Bool], _ kp: WritableKeyPath<Base, Tensor<Float>>)
宣言
public func keysEnding<Base>(with kp: WritableKeyPath<Base, Tensor<Float>>) -> [Bool]
宣言
func findFirstIndex<TrueBase, T>(
_ rootKeyPath: WritableKeyPath<TrueBase, Base>,
_ prefix: WritableKeyPath<TrueBase, T>, _ i: inout Int
) -> Bool
特定のプレフィックスで始まる最初のキーパスのインデックスを見つけます。注: すべての配列レイヤーは、1-past-the-end インデックス付けをサポートしています。
宣言
func firstIndex<T>(withPrefix prefix: WritableKeyPath<Base, T>) -> Int
2 つの KeyPath プレフィックスで定義された範囲内のすべてのキー インデックスを検索します: [ lower, upper)
宣言
public func allKeysBetween<T, U>(lower: WritableKeyPath<Base, T>, upper: WritableKeyPath<Base, U>)
-> [Bool]
`Base`: `KeyPathIterable` で利用可能
Base
の特定のインスタンス内のすべてのテンソルを訪問する計画を作成します。この計画は、構造的に同等のバージョンの Base に移行できます。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-09-11 UTC。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"必要な情報がない"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"複雑すぎる / 手順が多すぎる"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"最新ではない"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻訳に関する問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"サンプル / コードに問題がある"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"その他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"わかりやすい"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"問題の解決に役立った"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"その他"
}]
{"lastModified": "\u6700\u7d42\u66f4\u65b0\u65e5 2024-09-11 UTC\u3002"}
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2024-09-11 UTC。"]]