How to use get_outputs method in pytest-cov

Best Python code snippet using pytest-cov

module.py

Source:module.py Github

copy

Full Screen

...183 lam2=0.1184 lam3=0.1185 # self.temp_rbatch1.data[0] = dbatch1186 self.modG1.forward(mx.io.DataBatch([dbatch1],[None]))187 outG1 = self.modG1.get_outputs()[0]188 self.bce_loss.forward(mx.io.DataBatch([outG1],[dbatch2]))189 bceloss = self.bce_loss.get_outputs()[0]190 # for_back = mx.nd.ones(self.bce_loss.get_outputs()[0].shape, self.context[-1])/self.batch_size191 clip_grad(self.bce_loss)192 self.bce_loss.backward()193 bce_loss_grad = self.bce_loss.get_input_grads()[0]194 self.loss[0,0] = mx.nd.mean(bceloss).asnumpy()195 # self.modG1.backward([bce_loss_grad])196 D1_fake_input = mx.nd.zeros((outG1.shape[0], 4, outG1.shape[2],outG1.shape[3]),self.context[-1])197 D1_real_input = mx.nd.zeros((outG1.shape[0], 4, outG1.shape[2], outG1.shape[3]),self.context[-1])198 for i in range(outG1.shape[0]):199 D1_fake_input[i, :, :, :] = mx.nd.concat(dbatch1[i, :, :, :], outG1[i, :, :, :], dim=0)200 D1_real_input[i, :, :, :] = mx.nd.concat(dbatch1[i, :, :, :], dbatch2[i, :, :, :],dim=0)201 # forward D1202 self.temp_label[:] = 0203 self.modD1.forward(mx.io.DataBatch([D1_fake_input], [self.temp_label]), is_train=True)204 loss_d1_1 = mx.nd.mean(self.modD1.get_outputs()[0]).asnumpy().copy()205 for_back = mx.nd.ones(self.modD1.get_outputs()[0].shape, self.context[-1])/self.batch_size*lam1206 clip_grad(self.modD1)207 self.modD1.backward([for_back])208 self._save_temp_gradD1()209 self.temp_label[:] = 1210 self.modD1.forward(mx.io.DataBatch([D1_fake_input], [self.temp_label]), is_train=True)211 for_back = mx.nd.ones(self.modD1.get_outputs()[0].shape, self.context[-1])/self.batch_size*lam1212 clip_grad(self.modD1)213 self.modD1.backward([for_back])214 diffD1 = self.modD1.get_input_grads()[0].copy()215 self.outputs_fake1 = [x.copyto(x.context) for x in self.modD1.get_outputs()]216 self.temp_label[:] = 1217 self.modD1.forward(mx.io.DataBatch([D1_real_input], [self.temp_label]), is_train=True)218 # part2 = mx.nd.log(min_max_fun(self.modD1.get_outputs()[0]))219 # self.loss[0,1] = mx.nd.mean(0.1*(part1+part2)).asnumpy()220 loss_d1_2 = mx.nd.mean(self.modD1.get_outputs()[0]).asnumpy().copy()221 self.loss[0, 1] = loss_d1_1 + loss_d1_2222 for_back = mx.nd.ones(self.modD1.get_outputs()[0].shape,self.context[-1])/self.batch_size*lam1223 clip_grad(self.modD1)224 self.modD1.backward([for_back])225 self._add_temp_gradD1()226 self.outputs_real1 = self.modD1.get_outputs()227 # forward G2228 self.temp_rbatch2.data[0] = D1_fake_input229 self.modG2.forward(self.temp_rbatch2)230 outG2 = self.modG2.get_outputs()[0]231 self.l1_loss.forward(mx.io.DataBatch([outG2],[dbatch3]))232 l1loss = self.l1_loss.get_outputs()[0]233 for_back = mx.nd.ones(self.l1_loss.get_outputs()[0].shape,self.context[-1])/self.batch_size*lam2234 clip_grad(self.l1_loss)235 self.l1_loss.backward([for_back])236 l1_loss_grad = self.l1_loss.get_input_grads()[0]237 self.loss[0,2] = mx.nd.mean(l1loss).asnumpy()238 D2_fake_input = mx.nd.zeros((outG2.shape[0], 7, outG2.shape[2], outG2.shape[3]),self.context[-1])239 D2_real_input = mx.nd.zeros((outG2.shape[0], 7, outG2.shape[2], outG2.shape[3]),self.context[-1])240 for i in range(outG2.shape[0]):241 D2_fake_input[i, :, :, :] = mx.nd.concat(D1_fake_input[i, :, :, :], outG2[i, :, :, :], dim=0)242 D2_real_input[i, :, :, :] = mx.nd.concat(D1_real_input[i, :, :, :], dbatch3[i, :, :, :], dim=0)243 # forward D2244 self.temp_label[:] = 0245 self.modD2.forward(mx.io.DataBatch([D2_fake_input], [self.temp_label]), is_train=True)246 # part1 = mx.nd.log(1 - min_max_fun(self.modD2.get_outputs()[0]))247 loss_d2_1 = mx.nd.mean(self.modD2.get_outputs()[0]).asnumpy().copy()248 # self.loss[0, 3] = self.loss[0, 3] + mx.nd.mean(self.modD2.get_outputs()[0]).asnumpy()249 for_back = mx.nd.ones(self.modD2.get_outputs()[0].shape,self.context[-1])/self.batch_size*lam3250 clip_grad(self.modD2)251 self.modD2.backward([for_back])252 self._save_temp_gradD2()253 self.temp_label[:] = 1254 self.modD2.forward(mx.io.DataBatch([D2_fake_input], [self.temp_label]), is_train=True)255 self.loss[0, 3] = self.loss[0, 3] + mx.nd.mean(mx.nd.mean(self.modD2.get_outputs()[0])).asnumpy()256 for_back = mx.nd.ones(self.modD2.get_outputs()[0].shape,self.context[-1])/self.batch_size*lam3257 clip_grad(self.modD2)258 self.modD2.backward([for_back])259 diffD2 = self.modD2.get_input_grads()[0].copy()260 self.outputs_fake2 = [x.copyto(x.context) for x in self.modD2.get_outputs()]261 # for updating G2262 self.temp_label[:] = 1263 self.modD2.forward(mx.io.DataBatch([D2_real_input], [self.temp_label]), is_train=True)264 loss_d2_2 = mx.nd.mean(self.modD2.get_outputs()[0]).asnumpy().copy()265 self.loss[0, 3] = loss_d2_1 + loss_d2_2266 for_back = mx.nd.ones(self.modD2.get_outputs()[0].shape,self.context[-1])/self.batch_size*lam3267 clip_grad(self.modD2)268 self.modD2.backward([for_back])269 self._add_temp_gradD2()270 # diffD2 = self.modD2.get_input_grads()[0]271 self.outputs_real2 = self.modD2.get_outputs()272 # self.outputs_fake2 = [x.copyto(x.context) for x in self.modD2.get_outputs()]273 # update D2274 # self.temp_label[:] = self.pos_label275 # self.modD2.forward(mx.io.DataBatch([D2_real_input], [self.temp_label]), is_train=True)276 # self.modD2.backward()277 # self._add_temp_gradD2()278 self.modD2.update()279 # self.outputs_real2 = self.modD2.get_outputs()280 self.temp_outG2 = outG2281 # self.temp_diffD2 = diffD2282 # update D1283 # self.temp_label[:] = self.pos_label284 # self.modD1.forward(mx.io.DataBatch([D1_real_input], [self.temp_label]), is_train=True)285 # self.modD1.backward()286 # self._add_temp_gradD1()287 self.modD1.update()288 # self.outputs_real1 = self.modD1.get_outputs()289 self.temp_outG1 = outG1290 # self.temp_diffD1 = diffD1291 # update G2292 # self.modG2.backward([diffD2[:,4:,:,:]])293 clip_grad(self.modG2)294 self.modG2.backward([diffD2[:,4:,:,:] + l1_loss_grad])295 tmp_G2_grads = self.modG2.get_input_grads()[0]296 self.modG2.update()297 # update G1298 # self.modG1.backward([mx.nd.slice_axis(diffD1,axis=1,begin=3,end=4)299 # + mx.nd.slice_axis(diffD2,axis=1,begin=3,end=4)])300 clip_grad(self.modG1)301 self.modG1.backward([mx.nd.slice_axis(diffD1,axis=1,begin=3,end=4)302 + bce_loss_grad + mx.nd.slice_axis(diffD2,axis=1,begin=3,end=4)303 + mx.nd.slice_axis(tmp_G2_grads,axis=1,begin=3,end=4)])304 # self.modG1.backward([bce_loss_grad])305 self.modG1.update()306 def forward(self, dbatch1):307 self.temp_rbatch1.data[0] = dbatch1308 self.modG1.forward(self.temp_rbatch1)309 outG1 = self.modG1.get_outputs()[0]310 D1_fake_input = mx.nd.zeros((outG1.shape[0], 4, outG1.shape[2], outG1.shape[3]), self.context[-1])311 for i in range(outG1.shape[0]):312 D1_fake_input[i, :, :, :] = mx.nd.concat(dbatch1[i, :, :, :], outG1[i, :, :, :], dim=0)313 # forward G2314 self.temp_rbatch2.data[0] = D1_fake_input315 self.modG2.forward(self.temp_rbatch2)316 outG2 = self.modG2.get_outputs()[0]317 self.temp_outG2 = outG2318 self.temp_outG1 = outG1319# class SemiGANModule(GANBaseModule):320# """A semisupervised gan that can take both labeled and unlabeled data.321# """322# def __init__(self,323# symbol_generator,324# symbol_encoder,325# context,326# data_shape,327# code_shape,328# num_class,329# pos_label=0.9):330# super(SemiGANModule, self).__init__(331# symbol_generator, context, code_shape)332# # the discriminator encoder333# context = context if isinstance(context, list) else [context]334# batch_size = data_shape[0]335# self.num_class = num_class336# encoder = symbol_encoder337# encoder = mx.sym.FullyConnected(338# encoder, num_hidden=num_class + 1, name="energy")339# self.modD = mx.mod.Module(symbol=encoder,340# data_names=("data",),341# label_names=None,342# context=context)343# self.modD.bind(data_shapes=[("data", data_shape)],344# inputs_need_grad=True)345# self.pos_label = pos_label346# # discriminator loss347# energy = mx.sym.Variable("energy")348# label_out = mx.sym.SoftmaxOutput(energy, name="softmax")349# ul_pos_energy = mx.sym.slice_axis(350# energy, axis=1, begin=0, end=num_class)351# ul_pos_energy = ops.log_sum_exp(352# ul_pos_energy, axis=1, keepdims=True, name="ul_pos")353# ul_neg_energy = mx.sym.slice_axis(354# energy, axis=1, begin=num_class, end=num_class + 1)355# ul_pos_prob = mx.sym.LogisticRegressionOutput(356# ul_pos_energy - ul_neg_energy, name="dloss")357# # use module to bind the358# self.mod_label_out = mx.mod.Module(359# symbol=label_out,360# data_names=("energy",),361# label_names=("softmax_label",),362# context=context)363# self.mod_label_out.bind(364# data_shapes=[("energy", (batch_size, num_class + 1))],365# label_shapes=[("softmax_label", (batch_size,))],366# inputs_need_grad=True)367# self.mod_ul_out = mx.mod.Module(368# symbol=ul_pos_prob,369# data_names=("energy",),370# label_names=("dloss_label",),371# context=context)372# self.mod_ul_out.bind(373# data_shapes=[("energy", (batch_size, num_class + 1))],374# label_shapes=[("dloss_label", (batch_size,))],375# inputs_need_grad=True)376# self.mod_ul_out.init_params()377# self.mod_label_out.init_params()378# self.temp_label = mx.nd.zeros(379# (batch_size,), ctx=context[0])380#381# def update(self, dbatch, is_labeled):382# """Update the model for a single batch."""383# # generate fake image384# mx.random.normal(0, 1.0, out=self.temp_rbatch.data[0])385# self.modG.forward(self.temp_rbatch)386# outG = self.modG.get_outputs()387# self.temp_label[:] = self.num_class388# self.modD.forward(mx.io.DataBatch(outG, []), is_train=True)389# self.mod_label_out.forward(390# mx.io.DataBatch(self.modD.get_outputs(), [self.temp_label]), is_train=True)391# self.mod_label_out.backward()392# self.modD.backward(self.mod_label_out.get_input_grads())393# self._save_temp_gradD()394# # update generator395# self.temp_label[:] = 1396# self.modD.forward(mx.io.DataBatch(outG, []), is_train=True)397# self.mod_ul_out.forward(398# mx.io.DataBatch(self.modD.get_outputs(), [self.temp_label]), is_train=True)399# self.mod_ul_out.backward()400# self.modD.backward(self.mod_ul_out.get_input_grads())401# diffD = self.modD.get_input_grads()402# self.modG.backward(diffD)403# self.modG.update()404# self.outputs_fake = [x.copyto(x.context) for x in self.mod_ul_out.get_outputs()]405# # update discriminator406# self.modD.forward(mx.io.DataBatch(dbatch.data, []), is_train=True)407# outD = self.modD.get_outputs()408# self.temp_label[:] = self.pos_label409# self.mod_ul_out.forward(410# mx.io.DataBatch(outD, [self.temp_label]), is_train=True)411# self.outputs_real = [x.copyto(x.context) for x in self.mod_ul_out.get_outputs()]412# if is_labeled:413# self.mod_label_out.forward(414# mx.io.DataBatch(outD, dbatch.label), is_train=True)415# self.mod_label_out.backward()416# egrad = self.mod_label_out.get_input_grads()417# else:418# self.mod_ul_out.backward()419# egrad = self.mod_ul_out.get_input_grads()420# self.modD.backward(egrad)421# self._add_temp_gradD()422# self.modD.update()423# self.temp_outG = outG...

Full Screen

Full Screen

Test_ABE.py

Source:Test_ABE.py Github

copy

Full Screen

...17 self.board = Board(Canvas())18 def set_board_1010(self):19 self.set_board_10()20 self.board.connect_pins(21 self.src_A.get_outputs()[0], self.element.get_inputs()[2]22 )23 self.board.connect_pins(24 self.src_B.get_outputs()[0], self.element.get_inputs()[3]25 )26 def set_board_10101010(self):27 self.set_board_10()28 self.board.connect_pins(29 self.src_A.get_outputs()[0], self.element.get_inputs()[2]30 )31 self.board.connect_pins(32 self.src_B.get_outputs()[0], self.element.get_inputs()[3]33 )34 self.board.connect_pins(35 self.src_A.get_outputs()[0], self.element.get_inputs()[4]36 )37 self.board.connect_pins(38 self.src_B.get_outputs()[0], self.element.get_inputs()[5]39 )40 self.board.connect_pins(41 self.src_A.get_outputs()[0], self.element.get_inputs()[6]42 )43 self.board.connect_pins(44 self.src_B.get_outputs()[0], self.element.get_inputs()[7]45 )46 def set_board_01010101(self):47 self.set_board_01()48 self.board.connect_pins(49 self.src_A.get_outputs()[0], self.element.get_inputs()[2]50 )51 self.board.connect_pins(52 self.src_B.get_outputs()[0], self.element.get_inputs()[3]53 )54 self.board.connect_pins(55 self.src_A.get_outputs()[0], self.element.get_inputs()[4]56 )57 self.board.connect_pins(58 self.src_B.get_outputs()[0], self.element.get_inputs()[5]59 )60 self.board.connect_pins(61 self.src_A.get_outputs()[0], self.element.get_inputs()[6]62 )63 self.board.connect_pins(64 self.src_B.get_outputs()[0], self.element.get_inputs()[7]65 )66 def set_board_010(self):67 self.set_board_01()68 self.board.connect_pins(69 self.src_A.get_outputs()[0], self.element.get_inputs()[2]70 )71 def set_board_010100(self):72 self.set_board_01()73 self.board.connect_pins(74 self.src_A.get_outputs()[0], self.element.get_inputs()[2]75 )76 self.board.connect_pins(77 self.src_B.get_outputs()[0], self.element.get_inputs()[3]78 )79 self.board.connect_pins(80 self.src_A.get_outputs()[0], self.element.get_inputs()[4]81 )82 self.board.connect_pins(83 self.src_A.get_outputs()[0], self.element.get_inputs()[5]84 )85 def set_board_0101_0011_00_01(self):86 self.set_board_01()87 self.board.connect_pins(88 self.src_A.get_outputs()[0], self.element.get_inputs()[2]89 )90 self.board.connect_pins(91 self.src_B.get_outputs()[0], self.element.get_inputs()[3]92 )93 self.board.connect_pins(94 self.src_A.get_outputs()[0], self.element.get_inputs()[4]95 )96 self.board.connect_pins(97 self.src_A.get_outputs()[0], self.element.get_inputs()[5]98 )99 self.board.connect_pins(100 self.src_B.get_outputs()[0], self.element.get_inputs()[6]101 )102 self.board.connect_pins(103 self.src_B.get_outputs()[0], self.element.get_inputs()[7]104 )105 self.board.connect_pins(106 self.src_A.get_outputs()[0], self.element.get_inputs()[8]107 )108 self.board.connect_pins(109 self.src_A.get_outputs()[0], self.element.get_inputs()[9]110 )111 self.board.connect_pins(112 self.src_A.get_outputs()[0], self.element.get_inputs()[10]113 )114 self.board.connect_pins(115 self.src_B.get_outputs()[0], self.element.get_inputs()[11]116 )117 def set_board_10_00_10(self):118 self.set_board_10()119 self.board.connect_pins(120 self.src_B.get_outputs()[0], self.element.get_inputs()[2]121 )122 self.board.connect_pins(123 self.src_B.get_outputs()[0], self.element.get_inputs()[3]124 )125 self.board.connect_pins(126 self.src_A.get_outputs()[0], self.element.get_inputs()[4]127 )128 self.board.connect_pins(129 self.src_B.get_outputs()[0], self.element.get_inputs()[5]130 )131 # def set_shifters(self):132 # self.board.clear()133 # self.set_board_10()134 # self.shifter = self.board.create_element(self.el)135 # self.board.connect_pins(self.src_A.get_outputs()[0], self.shifter.get_inputs()[0])136 # self.board.connect_pins(self.src_B.get_outputs()[0], self.shifter.get_inputs()[1])137 # self.board.connect_pins(self.src_A.get_outputs()[0], self.shifter.get_inputs()[2])138 # self.board.connect_pins(self.src_B.get_outputs()[0], self.shifter.get_inputs()[3])139 def test_ShiftLeft(self):140 """Testing left shifter"""141 self.el = ShiftLeft142 self.board.clear()143 self.element = self.board.create_element(self.el)144 self.set_board_1010()145 self.assertEqual(146 [147 self.element.get_outputs()[i].get_state()148 for i in range(len(self.element.get_outputs()))149 ],150 [False, True, False, False],151 )152 def test_ShiftRight(self):153 """Testing left shifter"""154 self.el = ShiftRight155 self.board.clear()156 self.element = self.board.create_element(self.el)157 self.set_board_1010()158 self.assertEqual(159 [160 self.element.get_outputs()[i].get_state()161 for i in range(len(self.element.get_outputs()))162 ],163 [False, True, False, True],164 )165 def test_HalfAdder(self):166 """Testing half adder"""167 self.el = HalfAdder168 self.board.clear()169 self.element = self.board.create_element(self.el)170 self.set_board_11()171 self.assertEqual(172 [173 self.element.get_outputs()[i].get_state()174 for i in range(len(self.element.get_outputs()))175 ],176 [False, True],177 )178 def test_Adder(self):179 """Testing adder"""180 self.el = Adder181 self.board.clear()182 self.element = self.board.create_element(self.el)183 self.set_board_010()184 self.assertEqual(185 [186 self.element.get_outputs()[i].get_state()187 for i in range(len(self.element.get_outputs()))188 ],189 [True, False],190 )191 def test_HalfSubstractor(self):192 """Testing half substractor"""193 self.el = HalfSubstractor194 self.board.clear()195 self.element = self.board.create_element(self.el)196 self.set_board_10()197 self.assertEqual(198 [199 self.element.get_outputs()[i].get_state()200 for i in range(len(self.element.get_outputs()))201 ],202 [True, False],203 )204 def test_Substractor(self):205 """Testing substractor"""206 self.el = Substractor207 self.board.clear()208 self.element = self.board.create_element(self.el)209 self.set_board_010()210 self.assertEqual(211 [212 self.element.get_outputs()[i].get_state()213 for i in range(len(self.element.get_outputs()))214 ],215 [True, True],216 )217 def test_Decoder(self):218 """Testing decoder"""219 self.el = Decoder220 self.board.clear()221 self.element = self.board.create_element(self.el)222 self.set_board_010()223 self.assertEqual(224 [225 self.element.get_outputs()[i].get_state()226 for i in range(len(self.element.get_outputs()))227 ],228 [False, False, False, False, False, True, False, False],229 )230 def test_Encoder_4_to_2(self):231 """Testing 4-to-2 encoder"""232 self.el = Encoder_4_to_2233 self.board.clear()234 self.element = self.board.create_element(self.el)235 self.set_board_1010()236 self.assertEqual(237 [238 self.element.get_outputs()[i].get_state()239 for i in range(len(self.element.get_outputs()))240 ],241 [True, True, True],242 )243 def test_Encoder_8_to_3(self):244 """Testing 4-to-2 encoder"""245 self.el = Encoder_8_to_3246 self.board.clear()247 self.element = self.board.create_element(self.el)248 self.set_board_01010101()249 self.assertEqual(250 [251 self.element.get_outputs()[i].get_state()252 for i in range(len(self.element.get_outputs()))253 ],254 [True, True, False, True],255 )256 def test_Multiplexor(self):257 """Testing multiplexor"""258 self.el = Multiplexor259 self.board.clear()260 self.element = self.board.create_element(self.el)261 self.set_board_010100()262 self.assertEqual(263 [264 self.element.get_outputs()[i].get_state()265 for i in range(len(self.element.get_outputs()))266 ],267 [True],268 )269 def test_ALU_1_bit(self):270 """Testing 1-bit ALU"""271 self.el = ALU_1_bit272 self.board.clear()273 self.element = self.board.create_element(self.el)274 self.set_board_10_00_10()275 self.assertEqual(276 [277 self.element.get_outputs()[i].get_state()278 for i in range(len(self.element.get_outputs()))279 ],280 [False, False, False],281 )282 def test_ALU_4_bit(self):283 """Testing 4-bit ALU"""284 self.el = ALU_4_bit285 self.board.clear()286 self.element = self.board.create_element(self.el)287 self.set_board_0101_0011_00_01()288 self.assertEqual(289 [290 self.element.get_outputs()[i].get_state()291 for i in range(len(self.element.get_outputs()))292 ],293 [False, False, True, False, False, False],294 )295if __name__ == "__main__":...

Full Screen

Full Screen

aimedTest.py

Source:aimedTest.py Github

copy

Full Screen

1import math2def get_outputs(i, x, w, b):3 print(f"################### TEST #{i} ###################")4 print(f"X: {x}")5 print(f"W: {w}")6 print(f"b: {b}")7 sum = summation(x, w, b)8 print(f"Sum result:\t\t\t\t {sum}")9 f_z = sigmoid_output(sum)10 print(f"Sigmoid output:\t\t\t {f_z}")11 #the sum with 12 bits12 sum_in_circuit = round(sum/lsb_in)13 print(f"Sum value quantized:\t {sum_in_circuit}")14 f_z_in_circuit = round(f_z/lsb_out)15 print(f"Output value quantized:\t {f_z_in_circuit}")16def summation(x, w, b):17 sum = 018 for i in range(0, 10):19 sum += x[i]*w[i]20 sum += b21 return sum22def sigmoid_output(s):23 res = (1)/(1 + math.exp(-s))24 return res25lsb_out = (1)/(2**15 - 1)26lsb_in = (32)/(2**11 - 1)27#Test #128x = [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]29w = [1,1,1,1,1,1,1,1,1,1]30b = 031get_outputs(1, x, w, b)32#Test #233x = [-0.75,-0.75,-0.75,-0.75,-0.75,-0.75,-0.75,-0.75,-0.75,-0.75]34get_outputs(2, x, w, b)35#Test #336x = [-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5]37get_outputs(3, x, w, b)38#Test #439w = [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]40get_outputs(4, x, w, b)41#Test #542w = [0,0,0,0,0,0,0,0,0,0]43get_outputs(5, x, w, b)44#Test #645w = [-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5]46get_outputs(6, x, w, b)47#Test #748x = [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]49w = [1,1,1,1,1,1,1,1,1,1]50get_outputs(7, x, w, b)51#Test #852x = [0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75]53get_outputs(8, x, w, b)54#Test #955x = [1,1,1,1,1,1,1,1,1,1]56get_outputs(9, x, w, b)57#Test #1058b = 159get_outputs(10, x, w, b)60#Test #1161x = [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]62b = -1...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run pytest-cov automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful