-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
Showing
10 changed files
with
86 additions
and
68 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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2016, Tobias Hermann. | ||
// https://github.com/Dobiasd/frugally-deep | ||
// Distributed under the MIT License. | ||
// (See accompanying LICENSE file or at | ||
// https://opensource.org/licenses/MIT) | ||
|
||
#pragma once | ||
|
||
#include "fdeep/layers/layer.hpp" | ||
|
||
#include <string> | ||
|
||
namespace fdeep { namespace internal | ||
{ | ||
|
||
class unit_normalization_layer : public layer | ||
{ | ||
public: | ||
explicit unit_normalization_layer(const std::string& name, | ||
std::vector<int> axes) | ||
: layer(name), | ||
axes_(axes) | ||
{ | ||
} | ||
protected: | ||
std::vector<int> axes_; | ||
|
||
tensors apply_impl(const tensors& inputs) const override | ||
{ | ||
const auto& input = single_tensor_from_tensors(inputs); | ||
return {l2_normalize(input, axes_)}; | ||
} | ||
}; | ||
|
||
} } // namespace fdeep, namespace internal |
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