Tue 27 Aug 00:14:56 CEST 2024
This commit is contained in:
		
							parent
							
								
									0e846eb1cd
								
							
						
					
					
						commit
						357697823f
					
				
							
								
								
									
										27
									
								
								test/test-slp3.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								test/test-slp3.js
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,27 @@
 | 
			
		|||
var x = [[1,1,1,0,0,0],
 | 
			
		||||
         [1,0,1,0,0,0],
 | 
			
		||||
         [1,1,1,0,0,0],
 | 
			
		||||
         [0,0,1,1,1,0],
 | 
			
		||||
         [0,0,1,1,0,0],
 | 
			
		||||
         [0,0,1,1,1,0]];
 | 
			
		||||
var y = [1,
 | 
			
		||||
         1,
 | 
			
		||||
         1,
 | 
			
		||||
         0,
 | 
			
		||||
         0,
 | 
			
		||||
         0];
 | 
			
		||||
var t0=time();
 | 
			
		||||
var model = ml.learn({
 | 
			
		||||
    algorithm : ml.ML.SLP,
 | 
			
		||||
    x : x,
 | 
			
		||||
    y : y,
 | 
			
		||||
    epochs : 20000,
 | 
			
		||||
});
 | 
			
		||||
var t1=time()
 | 
			
		||||
 | 
			
		||||
print(toJSON(model).length+' Bytes')
 | 
			
		||||
print((t1-t0)+'ms');
 | 
			
		||||
a = [[1, 1, 0, 0, 0, 0],
 | 
			
		||||
     [0, 0, 0, 1, 1, 0],
 | 
			
		||||
     [1, 1, 1, 1, 1, 0]];
 | 
			
		||||
print(ml.classify(model,a));
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user