Skip to content
Models and examples built with Swift for TensorFlow
Jupyter Notebook Swift C Other
Branch: master
Clone or download

Latest commit

sgugger Use Epochs to load CoLA (#487)
* Use Epochs to load CoLA

* Add back the extract functions

* Rename

* Clean up doc comments and comments
Latest commit 08692fb May 5, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Autoencoder Add 1D VariationalAutoencoder (#401) Apr 28, 2020
Batcher Rename (#458) Apr 23, 2020
Benchmarks Splitting the wamupBatches parameter arguments. (#469) Apr 28, 2020
Catch Uses switch instead of ifs (#219) Nov 8, 2019
CycleGAN
DCGAN Remove all Dataset to use Batcher instead (#418) Mar 27, 2020
Datasets Use Epochs to load CoLA (#487) May 5, 2020
Examples Use Epochs to load CoLA (#487) May 5, 2020
FastStyleTransfer Replace _Raw resizing operations in FastStyleTransfer model (#415) Mar 30, 2020
GAN Remove all Dataset to use Batcher instead (#418) Mar 27, 2020
Gym squelch filepath warnings (#452) Apr 20, 2020
MiniGo build: add testing support to the CMake build (#352) Feb 27, 2020
Models
Support Use Collatable for TextBatch (#482) May 4, 2020
Tests Add ShuffleNetV2 (#427) Apr 29, 2020
cmake/modules build: add a CMake based build for the tensorflow-swift-models (#303) Feb 10, 2020
docker Update Dockerfile (#457) Apr 23, 2020
pix2pix
.gitignore Replace TensorFlow image loading with stb_image (#429) Apr 8, 2020
.swift-format Update .swift-format (#484) May 4, 2020
CMakeLists.txt Update CMakeLists.txt (#473) Apr 29, 2020
CODE_OF_CONDUCT.md Add markdown docs Apr 12, 2018
CONTRIBUTING.md Add markdown docs Apr 12, 2018
LICENSE Update LICENSE. May 4, 2018
Package.resolved CycleGan (#400) Apr 7, 2020
Package.swift Recommendation model Neural Collaborative Filtering (#406) Apr 28, 2020
README.md Update Readme to remove one last reference to stable (#481) May 5, 2020

README.md

Swift for TensorFlow Models

This repository contains TensorFlow models written in Swift.

Active development occurs on the master branch.

Use the tensorflow-xx branch that corresponds to the release you are using from Swift for TensorFlow releases. For example, for the 0.6 release, use the tensorflow-0.6 branch.

For general information about Swift for TensorFlow development, please visit tensorflow/swift.

Development

macOS and Linux

Use Swift Package Manager to develop Swift for TensorFlow models.

Build

swift build

Test

swift test

Windows

Use CMake to develop Swift for TensorFlow models.

Experimental CMake Support

There is experimental support for building with CMake. This is required to build the models on Windows, and can also be used to cross-compile the models and the demo programs.

NOTE: tests are currently not supported with the CMake based build.

It is highly recommended that you use CMake 3.16 or newer to ensure that -B and parallel builds function properly in the example commands below. To install this version on Ubuntu, we recommend following the instructions at Kitware's apt repo.

Prerequisite: Ninja build tool. Find installation commands for your favorite package manager here.

macOS:

# Configure
cmake                                                              \
  -B /BinaryCache/tensorflow-swift-models                          \
  -D BUILD_TESTING=YES                                             \
  -D CMAKE_BUILD_TYPE=Release                                      \
  -D CMAKE_Swift_COMPILER=$(TOOLCHAINS=tensorflow xcrun -f swiftc) \
  -G Ninja                                                         \
  -S /SourceCache/tensorflow-swift-models
# Build
cmake --build /BinaryCache/tensorflow-swift-models
# Test
cmake --build /BinaryCache/tensorflow-swift-models --target test

Linux:

# Configure
cmake                                     \
  -B /BinaryCache/tensorflow-swift-models \
  -D BUILD_TESTING=NO                     \
  -D CMAKE_BUILD_TYPE=Release             \
  -D CMAKE_Swift_COMPILER=$(which swiftc) \
  -G Ninja                                \
  -S /SourceCache/tensorflow-swift-models
# Build
cmake --build /BinaryCache/tensorflow-swift-models

Windows:

set SDKROOT=%SystemDrive%/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk
set DEVELOPER_LIBRARY_DIR=%SystemDrive%/Library/Developer/Platforms/Windows.platform/Developer/Library
: Configure
"%ProgramFiles%\CMake\bin\cmake.exe"                                                                                                                                                                                                                  ^
  -B %SystemDrive%/BinaryCache/tensorflow-swift-models                                                                                                                                                                                                ^
  -D BUILD_SHARED_LIBS=YES                                                                                                                                                                                                                            ^
  -D BUILD_TESTING=YES                                                                                                                                                                                                                                ^
  -D CMAKE_BUILD_TYPE=Release                                                                                                                                                                                                                         ^
  -D CMAKE_Swift_COMPILER=%SystemDrive%/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe                                                                                                                       ^
  -D CMAKE_Swift_FLAGS="-sdk %SDKROOT% -I %SDKROOT%/usr/lib/swift -L %SDKROOT%/usr/lib/swift/windows -I %DEVELOPER_LIBRARY_DIR%/XCTest-development/usr/lib/swift/windows/x86_64 -L %DEVELOPER_LIBRARY_DIR%/XCTest-development/usr/lib/swift/windows " ^
  -G Ninja                                                                                                                                                                                                                                            ^
  -S %SystemDrive%/SourceCache/tensorflow-swift-models
: Build
"%ProgramFiles%\CMake\bin\cmake.exe" --build %SystemDrive%/BinaryCache/tensorflow-swift-models
: Test
"%ProgramFiles%\CMake\bin\cmake.exe" --build %SystemDrive%/BinaryCache/tensorflow-swift-models --target test

Bugs

Please report model-related bugs and feature requests using GitHub issues in this repository.

Community

Discussion about Swift for TensorFlow happens on the [email protected] mailing list.

Contributing

We welcome contributions: please read the Contributor Guide to get started. It's always a good idea to discuss your plans on the mailing list before making any major submissions.

Code of Conduct

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

The Swift for TensorFlow community is guided by our Code of Conduct, which we encourage everybody to read before participating.

You can’t perform that action at this time.