-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(torch): ranger optimizer (ie rectified ADAM + lookahead) + \
adabelief + gradient centralizaton
- Loading branch information
Showing
16 changed files
with
1,664 additions
and
720 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* DeepDetect | ||
* Copyright (c) 2019-2020 Jolibrain | ||
* Author: Guillaume Infantes <[email protected]> | ||
* | ||
* This file is part of deepdetect. | ||
* | ||
* deepdetect is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* deepdetect is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with deepdetect. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "native_factory.h" | ||
|
||
namespace dd | ||
{ | ||
|
||
template <class TInputConnectorStrategy> | ||
NativeModule * | ||
NativeFactory::from_template(const std::string tdef, | ||
const APIData template_params, | ||
const TInputConnectorStrategy &inputc) | ||
{ | ||
(void)(tdef); | ||
(void)(template_params); | ||
(void)(inputc); | ||
return nullptr; | ||
} | ||
|
||
template <> | ||
NativeModule *NativeFactory::from_template<CSVTSTorchInputFileConn>( | ||
const std::string tdef, const APIData template_params, | ||
const CSVTSTorchInputFileConn &inputc) | ||
{ | ||
if (tdef.find("nbeats") != std::string::npos) | ||
{ | ||
std::vector<std::string> p; | ||
if (template_params.has("template_params")) | ||
p = template_params.get("template_params") | ||
.get<std::vector<std::string>>(); | ||
return new NBeats(inputc, p); | ||
} | ||
else | ||
return nullptr; | ||
} | ||
|
||
template NativeModule * | ||
NativeFactory::from_template(const std::string tdef, | ||
const APIData template_params, | ||
const TxtTorchInputFileConn &inputc); | ||
|
||
template NativeModule * | ||
NativeFactory::from_template(const std::string tdef, | ||
const APIData template_params, | ||
const ImgTorchInputFileConn &inputc); | ||
} |
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,3 +1,24 @@ | ||
/** | ||
* DeepDetect | ||
* Copyright (c) 2019-2020 Jolibrain | ||
* Author: Guillaume Infantes <[email protected]> | ||
* | ||
* This file is part of deepdetect. | ||
* | ||
* deepdetect is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* deepdetect is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with deepdetect. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef NATIVE_FACTORY_H | ||
#define NATIVE_FACTORY_H | ||
|
||
|
@@ -14,13 +35,7 @@ namespace dd | |
template <class TInputConnectorStrategy> | ||
static NativeModule *from_template(const std::string tdef, | ||
const APIData template_params, | ||
const TInputConnectorStrategy &inputc) | ||
{ | ||
(void)(tdef); | ||
(void)(template_params); | ||
(void)(inputc); | ||
return nullptr; | ||
} | ||
const TInputConnectorStrategy &inputc); | ||
|
||
static bool valid_template_def(std::string tdef) | ||
{ | ||
|
@@ -36,22 +51,5 @@ namespace dd | |
return false; | ||
} | ||
}; | ||
|
||
template <> | ||
NativeModule *NativeFactory::from_template<CSVTSTorchInputFileConn>( | ||
const std::string tdef, const APIData template_params, | ||
const CSVTSTorchInputFileConn &inputc) | ||
{ | ||
if (tdef.find("nbeats") != std::string::npos) | ||
{ | ||
std::vector<std::string> p; | ||
if (template_params.has("template_params")) | ||
p = template_params.get("template_params") | ||
.get<std::vector<std::string>>(); | ||
return new NBeats(inputc, p); | ||
} | ||
else | ||
return nullptr; | ||
} | ||
} | ||
#endif |
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,7 +1,33 @@ | ||
/** | ||
* DeepDetect | ||
* Copyright (c) 2019-2020 Jolibrain | ||
* Author: Guillaume Infantes <[email protected]> | ||
* | ||
* This file is part of deepdetect. | ||
* | ||
* deepdetect is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* deepdetect is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with deepdetect. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef NATIVE_NET_H | ||
#define NATIVE_NET_H | ||
|
||
#include "torch/torch.h" | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wunused-parameter" | ||
#include <torch/torch.h> | ||
#pragma GCC diagnostic pop | ||
|
||
#include "../torchinputconns.h" | ||
|
||
namespace dd | ||
{ | ||
|
Oops, something went wrong.