-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinitNeptune.py
More file actions
26 lines (20 loc) · 805 Bytes
/
initNeptune.py
File metadata and controls
26 lines (20 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import neptune.new as neptune
from neptune.new.integrations.tensorflow_keras import NeptuneCallback
from neptune.new.types import File
from neptuneCredentials import Cred
class Neptune:
def __init__(self, projectName="", api_token=""):
self.parameters={}
def startRun(self,parameters={}):
self.run = neptune.init(project=Cred.project, api_token=Cred.api_token)
self.run["model/parameters"] = parameters
return self.getcallback()
def stopRun(self):
self.run.stop()
def getcallback(self):
neptune_cbk = NeptuneCallback(run=self.run, base_namespace='metrics')
return neptune_cbk
def resetTags(self):
self.run["sys/tags"].clear()
def addTags(self,tags=[]):
self.run["sys/tags"].add(tags)