SlideShare une entreprise Scribd logo
1  sur  50
Compile and Run. No change. Good!
Don’t think of an elephant!  (ii) The TActivation class
How to implement the sigmoid? B3=IF(A3<=0.5,A3,1.0-A3)
[object Object],[object Object],[object Object]
Class Structure ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Bureaucratic stuff
 
 
 
So OUR own code for “activation.increase” should be a Strategy Pattern ,[object Object],[object Object],[object Object],[object Object]
Advantages of a strategy pattern ,[object Object],[object Object]
[object Object],[object Object]
How do we change a method to a strategy pattern? ,[object Object]
1. Create an interface that defines the strategic operation ,[object Object],[object Object],[object Object]
How do we change a method to a strategy pattern? ,[object Object],[object Object]
2.  Implement the interface with classes that represent each strategy ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How do we change a method to a strategy pattern? ,[object Object],[object Object],[object Object]
3.  Refactor the code to select and to use an instance of the right strategic class ,[object Object],[object Object]
(3.2)  Now on to include methods to set_activation_sigmoid, or set_activation_linear; hence we include in the TActivation Class:  ,[object Object]
[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
Copycat’s slipnet
Let’s do classes for  nodes  and for  links ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object]
[object Object],[object Object]
TLINK.Create_Link (Node1, Node2, Link_Type, Link_Distance, etc.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Rewriting… if spread_activation belongs to NODES… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
OR…if spread_activation belongs to LINKS… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
NODES Activation Data Data … Method Method Method … LINKS Distance Data Data … Method Method Method … The classes become strongly coupled. It will be very hard to change them in 2010. Practically impossible to include new links at runtime.
Welcome to the observer pattern! Can you imagine calling a method  without knowing which  method from which object you are calling?
 
 
How could we include a new display if they have all been hardcoded? By changing this code?  That would be bad!  We don’t want to change code.   What if we want to include a new display during runtime?
 
 
 
 
 
 
 
 
So here's what the design looks like: ,[object Object],[object Object],Node= subject/publisher Links=observers
So here's what the design looks like: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Node= subject/publisher Links=observers
NODES implement: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Links implement: ,[object Object],[object Object]
So here's what the design looks like: ,[object Object],[object Object],Node= subject/publisher Links=observers

Contenu connexe

Tendances

Tracking my face with matlab ws word format
Tracking my face with matlab ws word formatTracking my face with matlab ws word format
Tracking my face with matlab ws word format
Gaspard Ggas
 

Tendances (15)

10 strategy pattern
10 strategy pattern10 strategy pattern
10 strategy pattern
 
4759826-Java-Thread
4759826-Java-Thread4759826-Java-Thread
4759826-Java-Thread
 
Javascripts hidden treasures BY - https://geekyants.com/
Javascripts hidden treasures            BY  -  https://geekyants.com/Javascripts hidden treasures            BY  -  https://geekyants.com/
Javascripts hidden treasures BY - https://geekyants.com/
 
Trigger
TriggerTrigger
Trigger
 
Command and Adapter Pattern
Command and Adapter PatternCommand and Adapter Pattern
Command and Adapter Pattern
 
Tracking my face with matlab ws word format
Tracking my face with matlab ws word formatTracking my face with matlab ws word format
Tracking my face with matlab ws word format
 
Template Method Pattern
Template Method PatternTemplate Method Pattern
Template Method Pattern
 
Clean code
Clean codeClean code
Clean code
 
2. Design patterns. part #2
2. Design patterns. part #22. Design patterns. part #2
2. Design patterns. part #2
 
How and why I turned my old Java projects into a first-class serverless compo...
How and why I turned my old Java projects into a first-class serverless compo...How and why I turned my old Java projects into a first-class serverless compo...
How and why I turned my old Java projects into a first-class serverless compo...
 
Comparing different concurrency models on the JVM
Comparing different concurrency models on the JVMComparing different concurrency models on the JVM
Comparing different concurrency models on the JVM
 
Chain of responsibility
Chain of responsibilityChain of responsibility
Chain of responsibility
 
Programming in Java: Control Flow
Programming in Java: Control FlowProgramming in Java: Control Flow
Programming in Java: Control Flow
 
Java concurrency model - The Future Task
Java concurrency model - The Future TaskJava concurrency model - The Future Task
Java concurrency model - The Future Task
 
Behavioral Design Patterns
Behavioral Design PatternsBehavioral Design Patterns
Behavioral Design Patterns
 

En vedette (13)

How to beat Jeff Hawkins
How to beat Jeff HawkinsHow to beat Jeff Hawkins
How to beat Jeff Hawkins
 
You only get one life
You only get one life You only get one life
You only get one life
 
Semantic Web, circa 2008
Semantic Web, circa 2008Semantic Web, circa 2008
Semantic Web, circa 2008
 
Discos duros virtuales43
Discos duros virtuales43Discos duros virtuales43
Discos duros virtuales43
 
Carta a Santa (Viejito Pascuero)
Carta a Santa (Viejito Pascuero)Carta a Santa (Viejito Pascuero)
Carta a Santa (Viejito Pascuero)
 
herramientas wed2
herramientas wed2 herramientas wed2
herramientas wed2
 
herramientas wed2
herramientas wed2herramientas wed2
herramientas wed2
 
Web 2 0
Web 2 0Web 2 0
Web 2 0
 
Web 2.0 en el ámbito educativo
Web 2.0 en el ámbito educativoWeb 2.0 en el ámbito educativo
Web 2.0 en el ámbito educativo
 
Jazzy Graphic Designer
Jazzy Graphic Designer Jazzy Graphic Designer
Jazzy Graphic Designer
 
Presentacion Vuce
Presentacion VucePresentacion Vuce
Presentacion Vuce
 
1. Graduacao 2008
1. Graduacao 20081. Graduacao 2008
1. Graduacao 2008
 
O Mundo é Plano Cap 7
O Mundo é Plano Cap 7O Mundo é Plano Cap 7
O Mundo é Plano Cap 7
 

Similaire à 6. Compile And Run

Dot Net Accenture
Dot Net AccentureDot Net Accenture
Dot Net Accenture
Sri K
 
GDE Lab 1 – Traffic Light Pg. 1 Lab 1 Traffic L.docx
GDE Lab 1 – Traffic Light  Pg. 1     Lab 1 Traffic L.docxGDE Lab 1 – Traffic Light  Pg. 1     Lab 1 Traffic L.docx
GDE Lab 1 – Traffic Light Pg. 1 Lab 1 Traffic L.docx
budbarber38650
 
Interview Questions.docx
Interview Questions.docxInterview Questions.docx
Interview Questions.docx
ReddyRavi5
 
Data structures and algorithms lab2
Data structures and algorithms lab2Data structures and algorithms lab2
Data structures and algorithms lab2
Bianca Teşilă
 

Similaire à 6. Compile And Run (20)

Refactoring Tips by Martin Fowler
Refactoring Tips by Martin FowlerRefactoring Tips by Martin Fowler
Refactoring Tips by Martin Fowler
 
TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And Refactoring
 
Dot Net Accenture
Dot Net AccentureDot Net Accenture
Dot Net Accenture
 
Implementing the Adapter Design Pattern
Implementing the Adapter Design PatternImplementing the Adapter Design Pattern
Implementing the Adapter Design Pattern
 
How To Use IO Monads in Scala?
 How To Use IO Monads in Scala? How To Use IO Monads in Scala?
How To Use IO Monads in Scala?
 
Instant DBMS Homework Help
Instant DBMS Homework HelpInstant DBMS Homework Help
Instant DBMS Homework Help
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
 
Spring boot
Spring bootSpring boot
Spring boot
 
maXbox Starter 45 Robotics
maXbox Starter 45 RoboticsmaXbox Starter 45 Robotics
maXbox Starter 45 Robotics
 
Web technologies-course 12.pptx
Web technologies-course 12.pptxWeb technologies-course 12.pptx
Web technologies-course 12.pptx
 
Android Dagger 2
Android  Dagger 2Android  Dagger 2
Android Dagger 2
 
Android Application Development - Level 3
Android Application Development - Level 3Android Application Development - Level 3
Android Application Development - Level 3
 
GDE Lab 1 – Traffic Light Pg. 1 Lab 1 Traffic L.docx
GDE Lab 1 – Traffic Light  Pg. 1     Lab 1 Traffic L.docxGDE Lab 1 – Traffic Light  Pg. 1     Lab 1 Traffic L.docx
GDE Lab 1 – Traffic Light Pg. 1 Lab 1 Traffic L.docx
 
The Ring programming language version 1.9 book - Part 98 of 210
The Ring programming language version 1.9 book - Part 98 of 210The Ring programming language version 1.9 book - Part 98 of 210
The Ring programming language version 1.9 book - Part 98 of 210
 
How much do we know about Object-Oriented Programming?
How much do we know about Object-Oriented Programming?How much do we know about Object-Oriented Programming?
How much do we know about Object-Oriented Programming?
 
Interview Questions.docx
Interview Questions.docxInterview Questions.docx
Interview Questions.docx
 
C++.pptx
C++.pptxC++.pptx
C++.pptx
 
Reactive programming with rx java
Reactive programming with rx javaReactive programming with rx java
Reactive programming with rx java
 
Data structures and algorithms lab2
Data structures and algorithms lab2Data structures and algorithms lab2
Data structures and algorithms lab2
 
Can't Dance The Lambda
Can't Dance The LambdaCan't Dance The Lambda
Can't Dance The Lambda
 

Plus de Alexandre Linhares

(Slideshare Version) 3. The Nature Of Understanding
(Slideshare Version) 3. The Nature Of Understanding(Slideshare Version) 3. The Nature Of Understanding
(Slideshare Version) 3. The Nature Of Understanding
Alexandre Linhares
 
(Slideshare Version) 2. Emergence, Priming, And Understanding
(Slideshare Version) 2. Emergence, Priming, And Understanding(Slideshare Version) 2. Emergence, Priming, And Understanding
(Slideshare Version) 2. Emergence, Priming, And Understanding
Alexandre Linhares
 
O Mundo é Plano Cap 9+Conclusao
O Mundo é Plano Cap 9+ConclusaoO Mundo é Plano Cap 9+Conclusao
O Mundo é Plano Cap 9+Conclusao
Alexandre Linhares
 

Plus de Alexandre Linhares (20)

Hathor@FGV: Introductory notes by Dr. A. Linhares
Hathor@FGV: Introductory notes by Dr. A. LinharesHathor@FGV: Introductory notes by Dr. A. Linhares
Hathor@FGV: Introductory notes by Dr. A. Linhares
 
4. Serving Two Masters
4. Serving Two Masters4. Serving Two Masters
4. Serving Two Masters
 
(Slideshare Version) 3. The Nature Of Understanding
(Slideshare Version) 3. The Nature Of Understanding(Slideshare Version) 3. The Nature Of Understanding
(Slideshare Version) 3. The Nature Of Understanding
 
(Slideshare Version) 2. Emergence, Priming, And Understanding
(Slideshare Version) 2. Emergence, Priming, And Understanding(Slideshare Version) 2. Emergence, Priming, And Understanding
(Slideshare Version) 2. Emergence, Priming, And Understanding
 
1. The Game Of The Century
1. The Game Of The Century1. The Game Of The Century
1. The Game Of The Century
 
Taisa Secao3 A
Taisa Secao3 ATaisa Secao3 A
Taisa Secao3 A
 
The Club of Rome
The Club of Rome The Club of Rome
The Club of Rome
 
O Mundo é Plano Cap 8 B
O Mundo é Plano Cap 8 BO Mundo é Plano Cap 8 B
O Mundo é Plano Cap 8 B
 
A Cauda Longa Cap 1
A Cauda Longa Cap 1A Cauda Longa Cap 1
A Cauda Longa Cap 1
 
O Mundo é Plano Cap 9+Conclusao
O Mundo é Plano Cap 9+ConclusaoO Mundo é Plano Cap 9+Conclusao
O Mundo é Plano Cap 9+Conclusao
 
O Mundo é Plano Cap 8 A
O Mundo é Plano Cap 8 AO Mundo é Plano Cap 8 A
O Mundo é Plano Cap 8 A
 
The business school myth
The business school mythThe business school myth
The business school myth
 
Outline of Globalization course at FGV/EBAPE
Outline of Globalization course at FGV/EBAPEOutline of Globalization course at FGV/EBAPE
Outline of Globalization course at FGV/EBAPE
 
test
testtest
test
 
Mighty Wal-Mart
Mighty Wal-MartMighty Wal-Mart
Mighty Wal-Mart
 
Class 8
Class 8Class 8
Class 8
 
Class 6
Class 6Class 6
Class 6
 
Class 5
Class 5Class 5
Class 5
 
Class 4
Class 4Class 4
Class 4
 
Class 3
Class 3Class 3
Class 3
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

6. Compile And Run

  • 1. Compile and Run. No change. Good!
  • 2. Don’t think of an elephant! (ii) The TActivation class
  • 3. How to implement the sigmoid? B3=IF(A3<=0.5,A3,1.0-A3)
  • 4.
  • 5.
  • 6.  
  • 7.  
  • 8.  
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. NODES Activation Data Data … Method Method Method … LINKS Distance Data Data … Method Method Method … The classes become strongly coupled. It will be very hard to change them in 2010. Practically impossible to include new links at runtime.
  • 34. Welcome to the observer pattern! Can you imagine calling a method without knowing which method from which object you are calling?
  • 35.  
  • 36.  
  • 37. How could we include a new display if they have all been hardcoded? By changing this code? That would be bad! We don’t want to change code. What if we want to include a new display during runtime?
  • 38.  
  • 39.  
  • 40.  
  • 41.  
  • 42.  
  • 43.  
  • 44.  
  • 45.  
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.