Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
iperov
GitHub Repository: iperov/deepfacelab
Path: blob/master/core/leras/initializers/__init__.py
628 views
1
import numpy as np
2
from tensorflow.python.ops import init_ops
3
4
from core.leras import nn
5
6
tf = nn.tf
7
8
from .CA import CAInitializerSubprocessor
9
10
class initializers():
11
class ca (init_ops.Initializer):
12
def __call__(self, shape, dtype=None, partition_info=None):
13
return tf.zeros( shape, dtype=dtype, name="_cai_")
14
15
@staticmethod
16
def generate_batch( data_list, eps_std=0.05 ):
17
# list of (shape, np.dtype)
18
return CAInitializerSubprocessor (data_list).run()
19
20
nn.initializers = initializers
21
22