File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testModel/in Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ import tensorflow as tf
2+
3+ # Create an override model to classify pictures
4+
5+ class SequentialModel (tf .keras .Model ):
6+ def __init__ (self , ** kwargs ):
7+ super (SequentialModel , self ).__init__ (** kwargs )
8+
9+ self .flatten = tf .keras .layers .Flatten (input_shape = (28 , 28 ))
10+
11+ # Add a lot of small layers
12+ num_layers = 100
13+ self .my_layers = [tf .keras .layers .Dense (64 , activation = "relu" )
14+ for n in range (num_layers )]
15+
16+ self .dropout = tf .keras .layers .Dropout (0.2 )
17+ self .dense_2 = tf .keras .layers .Dense (10 )
18+
19+ def call (self , x ):
20+ x = self .flatten (x )
21+
22+ for layer in self .my_layers :
23+ x = layer (x )
24+
25+ x = self .dropout (x )
26+ x = self .dense_2 (x )
27+
28+ return x
29+
30+ if __name__ == '__main__' :
31+ input_data = tf .random .uniform ([20 , 28 , 28 ])
32+ print ("Input:" )
33+ print (type (input_data ))
34+ print (input_data )
35+
36+ model = SequentialModel ()
37+ result = model (input_data )
38+
39+ print ("Output:" )
40+ print (type (input_data ))
41+ print (result )
Original file line number Diff line number Diff line change 1+ tensorflow == 2.9.3
Original file line number Diff line number Diff line change 156156 <arg >-err:-super</arg >
157157 <arg >-err:-discouraged</arg >
158158 <arg >-err:-emptyBlock</arg >
159+ <arg >-err:-boxing</arg >
159160 </compilerArgs >
160161 </configuration >
161162 </plugin >
You can’t perform that action at this time.
0 commit comments