2023-mexico-scientific-programming-patterns's People
Forkers
claujuarez juanazua daranha rdcorona dcanulr afa-chem lu-morales arturo-pimentel haydeeperuyero sarahirosasgonzalez karinatc conimape lopcaf martinzh jafetmoon fabianhdzgtz tstmerf guillermoaguilar aspp-latam aspp-latam pjorgeea javiermasruiz2023-mexico-scientific-programming-patterns's Issues
Exercise: Step 1 Classes
Reformat the code in walker.py
from functions to a class
Exercise: Step 3 break out the context map initialization
- Move the context map initialization to 3 functions in a separate
context_maps.py
module - Modify the constructor of
Walker
to take acontext_map
array instead of amap_type
- Modify the notebook to use the new code
Remember to reload the notebook kernel when you modify the code in you modules, as modules are cached during the first import and changes would not be visible.
Exercise: Add a new method to the Particle class
- Make the function
update_position
into a method of the classParticle
- Where does the position
(x, y)
of the particle belong? Modify the constructor of the classParticle
if necessary
Exercise: Step 5 reproducibility
- Complete the
run.py
script - In the file, at the top we give the desired parameters for the run
- Create a context map and walker (see previous exercises for reference)
- Simulate a trajectory (see previous exercises for reference)
- Save the trajectory using
np.save()
, and also save some metadata - Run the
run.py
script twice and confirm the results are identical by plotting them using the provided notebook
Exercise: Step 4 break out the next step probability
- In a new module
next_steps_proposals.py
, write 2 functions for 2 different next step proposals: a Gaussian one (it's the one currently in theWalker
code) and a square one (you can find an example in the exercise notebook) - Modify the constructor of
Walker
to take as arguments 1) anext_step_proposal
function and 2) anext_step_proposal_arguments
dictionary containing the arguments to pass to the function - Modify the notebook to run two simulations, one with the Gaussian proposal and one with the square proposal
Remember to reload the notebook kernel when you modify the code in you modules, as modules are cached during the first import and changes would not be visible.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.