tensorflow custom c++ op

Ditutup Disiarkan 2 tahun lepas Dibayar semasa penghantaran
Ditutup Dibayar semasa penghantaran

hi, Im experimenting if fusing operations in tensorflow cause performance improvement, but dont know how to do it and cant find much example online, if you know how to do it, write the source code .cc .iso ,python wrapper and calculate gradient of it, n all the files then please contact me,

the ops i want to fuse arent very complicated just a few lines in recurrent neural network GRU cell :

from tensorflow import keras

import tensorflow as tf

def Initialize_One_Variable(units):

w_init = tf.random_uniform_initializer()

R_kernal = [login to view URL](initial_value=w_init(shape=(units, units)),trainable=True,)

return R_kernal

def Initialize_Variable(input_dim, units,):

w_init = tf.random_normal_initializer()

b_init = tf.zeros_initializer()

w_0 = [login to view URL](initial_value=w_init(shape=(input_dim, units)), trainable=True,)

b_0 = [login to view URL](initial_value=b_init(shape=(units)), trainable=True)

return w_0, b_0

class Custom_Layer([login to view URL]):

def __init__(self, input_tuple, **kwargs):

super(Custom_Layer, self).__init__()

input_shape, units = input_tuple

self.Hidden_Size = (int)(input_shape * 0.5)

[login to view URL] = input_shape

[login to view URL] = units

[login to view URL] = Initialize_One_Variable(self.Hidden_Size)

[login to view URL] = Initialize_One_Variable(self.Hidden_Size)

[login to view URL] = Initialize_One_Variable(self.Hidden_Size)

[login to view URL], [login to view URL] = Initialize_Variable([login to view URL],self.Hidden_Size)

[login to view URL], [login to view URL] = Initialize_Variable([login to view URL],self.Hidden_Size)

[login to view URL], [login to view URL] = Initialize_Variable([login to view URL],self.Hidden_Size)

self.w_out, self.b_out = Initialize_Variable(self.Hidden_Size,[login to view URL])

def get_config(self):

cfg = super().get_config()

return cfg

def Custom_Method(self, step_input, step_state, training):

r = [login to view URL]([login to view URL](step_input,[login to view URL]) + [login to view URL](step_state, [login to view URL]) + [login to view URL])

z = [login to view URL]([login to view URL](step_input,[login to view URL]) + [login to view URL](step_state, [login to view URL]) + [login to view URL])

h__ = [login to view URL]([login to view URL](step_input, [login to view URL]) + [login to view URL]([login to view URL](r, step_state),[login to view URL]) + [login to view URL])

h = (1-z) * h__ + z * step_state

output__ = [login to view URL]([login to view URL](h, self.w_out) + self.b_out)

return output__, h

def call(self, inputs, training=False):

unstack = [login to view URL](inputs, axis=1)

out1, hiddd = self.Custom_Method(unstack[0], tf.zeros_like(unstack[0][:,0:self.Hidden_Size]),training=training)

out2, hiddd = self.Custom_Method(unstack[1], hiddd,training=training)

out3, hiddd = self.Custom_Method(unstack[2], hiddd,training=training)

out4, hiddd = self.Custom_Method(unstack[3], hiddd,training=training)

return out4

Layer___ = Custom_Layer((12,9))

randomt = [login to view URL](shape=(64,4,7))

Layer___(randomt)

fuse these in one op :

r = [login to view URL]([login to view URL](step_input,[login to view URL]) + [login to view URL](step_state, [login to view URL]) + [login to view URL])

z = [login to view URL]([login to view URL](step_input,[login to view URL]) + [login to view URL](step_state, [login to view URL]) + [login to view URL])

h__ = [login to view URL]([login to view URL](step_input, [login to view URL]) + [login to view URL]([login to view URL](r, step_state),[login to view URL]) + [login to view URL])

h = (1-z) * h__ + z * step_state

output__ = [login to view URL]([login to view URL](h, self.w_out) + self.b_out)

Pengaturcaraan C++ Tensorflow

ID Projek: #30117170

Tentang projek

5 cadangan Projek jarak jauh Aktif 2 tahun lepas

5 pekerja bebas membida secara purata $4444 untuk pekerjaan ini

fabienbenoit1984

Hello! I did imlement custom tensorflow and tflite ops already for a customer. Can help with model inference and training optimization. Thanks. My offer is 10hours within 1 week.

$2222 HKD dalam 10 hari
(12 Ulasan)
5.4
Robber2021

Hi, Dear. I am C/C++/Tensorflow expert and have a lot experience. And I have an excellent team. Your project is right for me. If you select me for your project, you will necessarily success. Good luck.

$2000 HKD dalam 7 hari
(7 Ulasan)
3.6
oksanA56

Hi, Hope you are doing well! Thanks for sharing your project requirement with me. As a highly skilled OpenCV/Tensorflow/C/C++ developer, I can help you perfectly. I am very confident with my skills and I'd like to help Lagi

$5000 HKD dalam 7 hari
(0 Ulasan)
0.0
artekloc4

Hello, How are you? Thank you for watching my offers. Please check my portfolio. I can do it. I have already developed many projects such as Object Recognition and Tracking( Yolo), Face Recognition(Opencv, Tensorflow) Lagi

$5000 HKD dalam 7 hari
(0 Ulasan)
0.0