تحذير: هذا المشروع مهمل. كانت Swift for TensorFlow تجربة في منصة الجيل التالي للتعلم الآلي ، حيث تضمنت أحدث الأبحاث عبر التعلم الآلي والمترجمات والبرمجة القابلة للتفاضل وتصميم الأنظمة وما بعده. تمت أرشفته في فبراير 2021.
تسلسلي
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
public struct Sequential<Layer1: Module, Layer2: Layer>: Module
where Layer1.Output == Layer2.Input,
Layer1.TangentVector.VectorSpaceScalar == Layer2.TangentVector.VectorSpaceScalar
extension Sequential: Layer where Layer1: Layer
طبقة تتكون من طبقتين أخريين أو أكثر بالتسلسل.
أمثلة:
- قم ببناء نموذج إدراكي بسيط مكون من طبقتين لـ MNIST:
let inputSize = 28 * 28
let hiddenSize = 300
var classifier = Sequential {
Dense<Float>(inputSize: inputSize, outputSize: hiddenSize, activation: relu)
Dense<Float>(inputSize: hiddenSize, outputSize: 3, activation: identity)
}
- إنشاء جهاز تشفير تلقائي لـ MNIST:
var autoencoder = Sequential {
// The encoder.
Dense<Float>(inputSize: 28 * 28, outputSize: 128, activation: relu)
Dense<Float>(inputSize: 128, outputSize: 64, activation: relu)
Dense<Float>(inputSize: 64, outputSize: 12, activation: relu)
Dense<Float>(inputSize: 12, outputSize: 3, activation: relu)
// The decoder.
Dense<Float>(inputSize: 3, outputSize: 12, activation: relu)
Dense<Float>(inputSize: 12, outputSize: 64, activation: relu)
Dense<Float>(inputSize: 64, outputSize: 128, activation: relu)
Dense<Float>(inputSize: 128, outputSize: imageHeight * imageWidth, activation: tanh)
}
تصريح
public var layer1: Layer1
تصريح
public var layer2: Layer2
تصريح
public init(_ layer1: Layer1, _ layer2: Layer2)
تصريح
@differentiable(wrt: self)
public func callAsFunction(_ input: Layer1.Input) -> Layer2.Output
تصريح
public init(@LayerBuilder layers: () -> `Self`)
متاح حيث `Layer1`: `Layer`
تصريح
@differentiable
public func callAsFunction(_ input: Layer1.Input) -> Layer2.Output
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2023-12-01 (حسب التوقيت العالمي المتفَّق عليه)
[{
"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":"غير ذلك"
}]