Đã Đóng

tensorflow custom c++ op

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)

Kĩ năng: Lập trình C++, Tensorflow

Xem nhiều hơn: custom tshirt flash application source code, custom greeting card source code, j2me custom list source code, customize custom c wrapper for unifi wireless access point creation creation source code provided, customize custom c# wrapper for unifi wireless access point creation creation (source code provided), hi im a graduated graphic designer, tensorflow custom op example, tensorflow custom op python, tensorflow custom gradient, tensorflow custom op, tensorflow custom operation, tensorflow custom layer, tensorflow lite c++, tensorflow lite c++ example, hi im mat outdoor mat, hi im matt door mat, tensorflow custom model, tensorflow custom loss function, hi im a gamer, tensorflow custom dataset

Về Bên Thuê:
( 0 nhận xét ) Central, Hong Kong

ID dự án: #30117170

5 freelancer chào giá trung bình$4444 cho công việc này

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 trong 10 ngày
(12 Nhận xét)
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 trong 7 ngày
(7 Nhận xét)
3.6
Liuxing888

✨Hi✨ I read your requirements very carefully. [login to view URL] I developed above website, I have used python ML module to segment image. My main goal is to make clients satisfaction and success. Thêm

$8000 HKD trong 15 ngày
(0 Nhận xét)
0.0
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 Thêm

$5000 HKD trong 7 ngày
(0 Nhận xét)
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) Thêm

$5000 HKD trong 7 ngày
(0 Nhận xét)
0.0