Skip to content

Commit

Permalink
Add save function
Browse files Browse the repository at this point in the history
  • Loading branch information
ProfFan committed Nov 29, 2020
1 parent fbe71f0 commit ac42a90
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/BeeTracking/AppearanceRAE.swift
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,12 @@ public struct PretrainedDenseRAE: AppearanceModelEncoder {
)
}

/// Save the weight to file
public func save(to path: String) {
let np = Python.import("numpy")
np.save(path, np.array(inner.numpyWeights, dtype: Python.object))
}

@differentiable
public func encode(_ imageBatch: Tensor<Double>) -> Tensor<Double> {
inner.encode(imageBatch)
Expand Down

0 comments on commit ac42a90

Please sign in to comment.