-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
348a2fe
commit 4342175
Showing
6 changed files
with
16 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1 @@ | ||
abstract type Model end | ||
# The following should be defined for a model: | ||
# (f::Model)() | ||
# (f::Model)(x) | ||
# (f::Model)(x,y) | ||
# (f::Model)(d::Data) | ||
|
||
# Alternative functions: | ||
# params(f::Model) where {T<:Model} = try f(); catch e; error("params(::$T) should give an iterator over parameters."); end | ||
# predict(f::Model,x) where {T<:Model} = try f(x); catch e; error("(::$T)(x) should be implemented as the predict function."); end | ||
# loss(f::Model,x,y) where {T<:Model} = try f(x,y); catch e; error("(::$T)(x,y) should be implemented as a loss function."); end | ||
# loss(f::Model,d::Data) = mean(f(x[1],x[2]) for x in d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters