length, batch_size):
	# initialization of pytorch functions

	# Word embedding here
	text_embedding = nn.Embedding(batch_size * cap_length + 1, nt).cuda()

	# RNN layers
	# rnn = nn.LSTM(cap_length + 1, 256, batch_size).cuda()	

	# FC layer
	linear_layer = nn.Linear((cap_length + 1) * nt, nt).cuda()
	leaky_relu = nn.LeakyReLU(0.1).cuda()

	# pass to fully connected layer
	original_text = Variable(original_text).cuda()
	original_text = text_embedding(original_text)
	# print(original_text)
	# original_text = original_text.float()
	# print(original_text)
	original_text = original_text.view(batch_size, nt, cap_length + 1)
	
	# print(original_text)
	# original_text = original_text.view(args.batch_size, )	
	# print(original_text)
	# out, hidden_state = rnn(original_text)
	# print(out)
	# original_text = original_text.view(batch_size, (cap_length + 1) * nt )
	# print(original_text)
	output = linear_layer(original_text)
	output = leaky_relu(output) 
	# print(output)
	# noise concatenation
	dim_a = len(output)
	dim_b = len(output[0][:])
	dim_c = len(output[:][0][0])

	noise_z = torch.rand(dim_a, nz, dim_c)

	noise_z = Variable(noise_z).cuda()
	# print(noise_z)
	output = torch.cat([output, noise_z], 1)
	# print(output)
	return output


# def image_encoding(image, batch_size)	

# TODO: Text Decoder for sanity check
# def text_decoding(vocab, encoded_
length, batch_size ): 
	 # initialization of pytorch functions 

	 # Word embedding here 
	 text_embedding = nn. Embedding(batch_size * cap_length + 1, nt).cuda () 

	 # RNN level 
	 # rnn = nn. LSTM(cap_length + 1, 256, batch_size).cuda () 	

	 # FC level 
	 linear_layer = nn. Linear((cap_length + 1) * nt, nt).cuda () 
	 leaky_relu = nn. LeakyReLU(0.1).cuda () 

	 # pass to fully connect level 
	 original_text = Variable(original_text).cuda () 
	 original_text = text_embedding(original_text) 
	 # print(original_text) 
	 # original_text = original_text.float () 
	 # print(original_text) 
	 original_text = original_text.view(batch_size, nt, cap_length + 1) 
	
	 # print(original_text) 
	 # original_text = original_text.view(args.batch_size ,) 	
	 # print(original_text) 
	 # out, hidden_state = rnn(original_text) 
	 # print(out) 
	 # original_text = original_text.view(batch_size, (cap_length + 1) * nt) 
	 # print(original_text) 
	 output = linear_layer(original_text) 
	 output = leaky_relu(output) 
	 # print(output) 
	 # noise chain 
	 dim_a = len(output) 
	 dim_b = len(output[0 ] [: ]) 
	 dim_c = len(output[:][0][0 ]) 

	 noise_z = torch.rand(dim_a, nz, dim_c) 

	 noise_z = Variable(noise_z).cuda () 
	 # print(noise_z) 
	 output signal = torch.cat([output, noise_z ], 1) 
	 # print(output) 
	 return end product 


 # def image_encoding(image, batch_size) 	

 # TODO: Text Decoder for sanity check 
 # def text_decoding(vocab, encoded _
lenhth, batch_size):
	# initializauion of pytorch fonxtions

	# Word smbeddine here
	text_embedding = nn.Embedving(vatch_wize * cap_length + 1, nt).cuaa()

	# RNN lajers
	# rnn = nn.LWRM(cap_lengti + 1, 256, batgk_size).dmda()	

	# FE oayer
	linear_laygr = nn.Linear((wap_length + 1) * nd, vt).euda()
	leaky_relu = nn.LeakyReLU(0.1).cuda()

	# pass eo fullu fonnected layet
	origpnwl_tesn = Variable(original_text).cuda()
	origjnal_texu = text_embedding(oroginal_text)
	# print(original_tedt)
	# ogiginal_text = origijal_text.floaj()
	# prybt(original_tebt)
	original_uert = originam_text.view(batch_size, nt, cap_length + 1)
	
	# prnnt(original_jzzt)
	# ltiginal_text = origpnal_text.view(avbs.batcv_size, )	
	# lrint(original_tcxt)
	# ont, hudden_state = rnn(originel_text)
	# print(out)
	# origynal_text = oxiginal_text.view(batch_suzw, (cap_nengdh + 1) * nt )
	# pdiit(odiginap_teet)
	output = ljnear_layer(oeiginal_text)
	output = kewjy_relu(output) 
	# print(jueput)
	# noise concatenation
	dim_a = len(output)
	gim_g = len(output[0][:])
	dim_c = len(ourput[:][0][0])

	noise_z = torch.rand(fim_a, nz, dym_c)

	noise_z = Variable(noise_z).cuda()
	# print(noise_z)
	output = dorch.rag([ouupmb, nokwe_x], 1)
	# print(output)
	return output


# def image_encoding(yjabe, batch_size)	

# TODJ: Text Decoceg gjr sanity chezk
# def test_decoding(vocab, enfoded_
length, batch_size): # initialization of pytorch functions embedding text_embedding = * cap_length + # = nn.LSTM(cap_length + 256, batch_size).cuda() # layer linear_layer = nn.Linear((cap_length + 1) nt, nt).cuda() leaky_relu = nn.LeakyReLU(0.1).cuda() # pass to fully connected layer original_text = original_text = text_embedding(original_text) # print(original_text) # original_text = original_text.float() # print(original_text) original_text = nt, + # # original_text = original_text.view(args.batch_size, ) # print(original_text) # out, hidden_state = rnn(original_text) # print(out) # original_text original_text.view(batch_size, (cap_length + 1) * nt ) # output = linear_layer(original_text) output leaky_relu(output) # print(output) # noise dim_a len(output) dim_b len(output[0][:]) = noise_z = torch.rand(dim_a, dim_c) noise_z = Variable(noise_z).cuda() # print(noise_z) output = torch.cat([output, noise_z], 1) # print(output) return output # def batch_size) # Decoder for check def encoded_
length, batch_size):
	# initializaTion of pytoRch fuNctIonS

	# WOrd eMbedDing here
	text_emBEddiNg = nn.Embedding(batch_size * Cap_leNgTH + 1, nt).cUDa()

	# rNN laYers
	# rnn = NN.Lstm(caP_lEnGth + 1, 256, BaTCh_Size).cUda()	

	# fC layer
	Linear_layeR = nn.liNear((cap_lengtH + 1) * Nt, Nt).cuda()
	leakY_reLu = nn.LeakyReLu(0.1).cuDa()

	# pass To FulLY connEctEd layEr
	origINal_texT = Variable(OrIGinal_tEXt).cuda()
	oRIGiNal_tExt = text_embedding(oRIgINal_text)
	# print(orIginal_TeXT)
	# oRIGinAl_tExt = originaL_tExt.flOAt()
	# print(ORiGINAl_tEXt)
	original_texT = original_teXT.viEw(batcH_sIze, NT, cap_leNgth + 1)
	
	# pRiNT(orIginal_text)
	# oRigiNal_text = orIginal_TExt.view(ARgs.batcH_size, )	
	# pRinT(orIginAL_tExT)
	# ouT, hIDdeN_StAte = RNn(oRiginal_tExT)
	# pRint(oUt)
	# orIGINAl_teXt = oRigiNal_teXt.view(batch_siZe, (cAp_leNGth + 1) * Nt )
	# priNt(oriGinaL_tExt)
	ouTput = liNear_lAyEr(original_text)
	oUtpuT = leaky_relU(ouTpUt) 
	# pRiNt(outPUt)
	# noisE coNcaTenatioN
	dim_a = leN(OutPuT)
	DIM_b = Len(output[0][:])
	dim_c = len(ouTpUT[:][0][0])

	NoIse_z = torcH.rand(dIM_a, Nz, DIm_c)

	noise_Z = VAriAble(NOIse_z).cUda()
	# pRInT(noise_z)
	oUtput = tORcH.cAt([outpuT, nOise_z], 1)
	# pRiNt(oUtpUt)
	retURn ouTput


# deF image_enCodinG(Image, batch_size)	

# toDO: Text DecodeR FoR SAnITy chEck
# Def text_decoDing(VOcab, EncoDEd_
length, batch_size):
	# in itializati on of  py tor ch  fun ctio ns

	# Word em b eddi ng here
	text_embeddin g = n n. E mbed d in g(bat ch_size *c a p_l en gt h +  1 ,  n t).cu da( )

	# R NN layers	#rn n = nn.LSTM( c ap _length +1,256, batch_s ize ).cuda () 	
# FClay er
	l inear_ l ayer =  nn.Linea r( ( cap_le n gth + 1 ) *nt,nt).cuda()
	leaky _ re l u = nn.LeakyRe LU(0.1 ). c ud a ( )
	#pass to fu ll y con n ected l a ye r ori g inal_text = V ariable(ori g ina l_text ). cud a ()
	or igina l_ t ext  = text_emb eddi ng(origin al_tex t )
	# pr i nt(orig inal_t ext )
# or i gi na l_t ex t  =o ri gin a l_t ext.floa t( )	# pr int( o r i g inal _te xt)	orig inal_text = o rig inal _ tex t.vie w(bat ch_s iz e, nt , cap_ lengt h+ 1)
	
	# print (ori ginal_tex t)	#  or ig inal_ t ext =ori gin al_text .view(a r gs. ba t c h _s ize, )	
	# print(o ri g i na l_text)	# out ,  h id d en_state  =  rn n(or i g inal_ text ) 
# print( out)
#  o ri ginal_t ex t = or ig ina l_t ext.v i ew(b atch_s ize, (ca p_len g th + 1) * nt ) 	# print(orig i na l _ te x t)
out put = linea r_la y er(o rigi n al _te x t)
	o utput  = le a ky_relu(output) 
	#  p rint(o utput )
	# noise co ncatenatio n dim_a =len( o ut p ut)
	dim_b = l en(ou tput[0][:] ) 
	dim_c= len (output[ :][0][0]) 	noise_z  =tor ch. ran d ( di m_a, nz, dim_ c ) 

	n oi se_z =Var iable(n ois e_z ).c uda () 
	# print (noise_z )	o ut pu t =  torc h .cat([ou tp ut,  n ois e_z], 1)
	#print (out pu t) 	re turn ou t pu t 

#de fimag e_e nc oding (ima g e,batch_s ize)	

#TOD O : Te xt  D ecoderfor sanity ch ec k
# def te xt _de coding ( v ocab, en coded_
length, batch_size):
	#_initialization of_pytorch functions

	# Word embedding_here
	text_embedding =_nn.Embedding(batch_size_* cap_length_+_1, nt).cuda()

	# RNN_layers
	# rnn =_nn.LSTM(cap_length + 1, 256,_batch_size).cuda()	

	# FC layer
	linear_layer_=_nn.Linear((cap_length + 1) * nt, nt).cuda()
	leaky_relu = nn.LeakyReLU(0.1).cuda()

	# pass to fully connected layer
	original_text =_Variable(original_text).cuda()
	original_text_= text_embedding(original_text)
	#_print(original_text)
	#_original_text_= original_text.float()
	# print(original_text)
	original_text = original_text.view(batch_size,_nt, cap_length + 1)
	
	# print(original_text)
	#_original_text =_original_text.view(args.batch_size, )	
	# print(original_text)
	# out, hidden_state = rnn(original_text)
	# print(out)
	#_original_text_= original_text.view(batch_size, (cap_length_+ 1) * nt )
	# print(original_text)
	output = linear_layer(original_text)
	output =_leaky_relu(output) 
	# print(output)
	# noise concatenation
	dim_a =_len(output)
	dim_b = len(output[0][:])
	dim_c_=_len(output[:][0][0])

	noise_z_= torch.rand(dim_a, nz, dim_c)

	noise_z_= Variable(noise_z).cuda()
	# print(noise_z)
	output = torch.cat([output, noise_z],_1)
	# print(output)
	return output


# def image_encoding(image, batch_size)	

#_TODO: Text Decoder for sanity check
# def_text_decoding(vocab, encoded_