New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to replicate Numpy examples #19

Closed
SergeStinckwich opened this Issue Dec 8, 2016 · 12 comments

Comments

2 participants
@SergeStinckwich
Member

SergeStinckwich commented Dec 8, 2016

Try to reproduce NumPy examples like the one found here:

https://docs.scipy.org/doc/numpy/user/quickstart.html
or
https://github.com/jakevdp/PythonDataScienceHandbook

Commit examples in PolyMath repository. If functions are missing, implement them.

@KupynOrest KupynOrest self-assigned this Dec 13, 2016

@SergeStinckwich

This comment has been minimized.

Show comment
Hide comment
@SergeStinckwich

SergeStinckwich Dec 23, 2016

Member

Any updates on this issue ? Should implement the examples are methods that we could commit on the repository later.

Member

SergeStinckwich commented Dec 23, 2016

Any updates on this issue ? Should implement the examples are methods that we could commit on the repository later.

@KupynOrest

This comment has been minimized.

Show comment
Hide comment
@KupynOrest

KupynOrest Dec 26, 2016

Contributor

Yes, I am working on this, sorry for the late answer, I got plenty of deadlines previous week

Contributor

KupynOrest commented Dec 26, 2016

Yes, I am working on this, sorry for the late answer, I got plenty of deadlines previous week

@KupynOrest

This comment has been minimized.

Show comment
Hide comment
@KupynOrest

KupynOrest Dec 31, 2016

Contributor

@SergeStinckwich At the moment I am reading Numerical Methods Book and working with matrices, I've recreated few simple examples from NumPy and I have some questions

  • For example, I do not see an implementation of elementwise matrix product, I can add a method plus a Matlab-style operator (A .* B). Would it be ok?

  • The next questions is in what format can I commit the examples and changes to PolyMath lib? Should I create a separate branch in this repository?

  • I also can implement some extra methods which can be useful, for example I do not see an implementation for SVD decomposition. Does it make sense?

Thanks.

Contributor

KupynOrest commented Dec 31, 2016

@SergeStinckwich At the moment I am reading Numerical Methods Book and working with matrices, I've recreated few simple examples from NumPy and I have some questions

  • For example, I do not see an implementation of elementwise matrix product, I can add a method plus a Matlab-style operator (A .* B). Would it be ok?

  • The next questions is in what format can I commit the examples and changes to PolyMath lib? Should I create a separate branch in this repository?

  • I also can implement some extra methods which can be useful, for example I do not see an implementation for SVD decomposition. Does it make sense?

Thanks.

@SergeStinckwich

This comment has been minimized.

Show comment
Hide comment
@SergeStinckwich

SergeStinckwich Jan 1, 2017

Member
  • If you don't see any implementation, you can implement it. Please implement unit tests also

  • You can push your changes, modifications, examples etc to main branches of PolyMath. We have an inbox for that: http://smalltalkhub.com/#!/~PolyMath/PolyMathInbox

  • yes if there is no implementation

Member

SergeStinckwich commented Jan 1, 2017

  • If you don't see any implementation, you can implement it. Please implement unit tests also

  • You can push your changes, modifications, examples etc to main branches of PolyMath. We have an inbox for that: http://smalltalkhub.com/#!/~PolyMath/PolyMathInbox

  • yes if there is no implementation

@KupynOrest

This comment has been minimized.

Show comment
Hide comment
@KupynOrest

KupynOrest Jan 27, 2017

Contributor

@SergeStinckwich Hello, I have some examples and methods to push but I can not see anything at the link you sent in a previous message ( http://smalltalkhub.com/#!/~PolyMath/PolyMathInbox ). Maybe there is a problem with an access?

Contributor

KupynOrest commented Jan 27, 2017

@SergeStinckwich Hello, I have some examples and methods to push but I can not see anything at the link you sent in a previous message ( http://smalltalkhub.com/#!/~PolyMath/PolyMathInbox ). Maybe there is a problem with an access?

@SergeStinckwich

This comment has been minimized.

Show comment
Hide comment
@SergeStinckwich

SergeStinckwich Jan 31, 2017

Member

The link is correct, but github replace ~ with something else. Check the link !

Member

SergeStinckwich commented Jan 31, 2017

The link is correct, but github replace ~ with something else. Check the link !

@KupynOrest

This comment has been minimized.

Show comment
Hide comment
@KupynOrest

KupynOrest Feb 10, 2017

Contributor

Hello, I've implemented a number of different functions, here is a small set of examples. Let me know please if it is okay.
Polymath.pdf

Contributor

KupynOrest commented Feb 10, 2017

Hello, I've implemented a number of different functions, here is a small set of examples. Let me know please if it is okay.
Polymath.pdf

@SergeStinckwich

This comment has been minimized.

Show comment
Hide comment
@SergeStinckwich

SergeStinckwich Feb 12, 2017

Member

Don't put pdf here. Better to just copy-paste your example here.

Member

SergeStinckwich commented Feb 12, 2017

Don't put pdf here. Better to just copy-paste your example here.

@KupynOrest

This comment has been minimized.

Show comment
Hide comment
@KupynOrest

KupynOrest Feb 13, 2017

Contributor
|a b c d|
"This is how we can create a matrix, a and b are 2x3 matrices in
this example"
a := DhbMatrix rows: #( ( 1 0 1 ) (-1 -2 3)).
b := DhbMatrix rows: #( ( 1 2 3 ) (-2 1 7)).

"Matrix product"
c := a * b.

"Elementwise matrix product"
d := a dot:b.

"This is how we can create a vector"
a := #(1 4 9 16 25) asDhbVector.

"Vectors and Matrices support basic logical and arithmetic
operations"
Float pi sin * d.
a sqrt.
a > 3.
c cos.
c < 0.

"It is possible to create a vector/matrix of random numbers"
a := DhbVector randomSize: 10 maxNumber: 3.
b := DhbMatrix rows: 2 columns: 3 random: 5.

"It is also easy to create a vector/matrix of zeros/ones"
a := DhbVector ones:15.
b := DhbMatrix zerosRows: 2 cols: 3.

"We can also compute the cumulative sum or regular sum the vector/
matrix as following"
a := DhbMatrix rows: #( ( 1 0 1 ) (-1 -2 3)).
a cumsum.
"a DhbVector(1 1 2)"
"a DhbVector(-1 -3 0)"
a sum.
"a DhbVector(2 0)"

"Matrix trace (sum of a diagonal elements for a square matrix)"
a := DhbMatrix rows: #((1 2 3)(4 5 6)(7 8 9)).
a trace.
"15"
Contributor

KupynOrest commented Feb 13, 2017

|a b c d|
"This is how we can create a matrix, a and b are 2x3 matrices in
this example"
a := DhbMatrix rows: #( ( 1 0 1 ) (-1 -2 3)).
b := DhbMatrix rows: #( ( 1 2 3 ) (-2 1 7)).

"Matrix product"
c := a * b.

"Elementwise matrix product"
d := a dot:b.

"This is how we can create a vector"
a := #(1 4 9 16 25) asDhbVector.

"Vectors and Matrices support basic logical and arithmetic
operations"
Float pi sin * d.
a sqrt.
a > 3.
c cos.
c < 0.

"It is possible to create a vector/matrix of random numbers"
a := DhbVector randomSize: 10 maxNumber: 3.
b := DhbMatrix rows: 2 columns: 3 random: 5.

"It is also easy to create a vector/matrix of zeros/ones"
a := DhbVector ones:15.
b := DhbMatrix zerosRows: 2 cols: 3.

"We can also compute the cumulative sum or regular sum the vector/
matrix as following"
a := DhbMatrix rows: #( ( 1 0 1 ) (-1 -2 3)).
a cumsum.
"a DhbVector(1 1 2)"
"a DhbVector(-1 -3 0)"
a sum.
"a DhbVector(2 0)"

"Matrix trace (sum of a diagonal elements for a square matrix)"
a := DhbMatrix rows: #((1 2 3)(4 5 6)(7 8 9)).
a trace.
"15"
@SergeStinckwich

This comment has been minimized.

Show comment
Hide comment
@SergeStinckwich

SergeStinckwich Feb 13, 2017

Member

I refactor DHBXXX classes names to PMXXX in last version of PolyMath (v0.80).
Can you modified your example accordingly ? Thank you.

Member

SergeStinckwich commented Feb 13, 2017

I refactor DHBXXX classes names to PMXXX in last version of PolyMath (v0.80).
Can you modified your example accordingly ? Thank you.

@KupynOrest

This comment has been minimized.

Show comment
Hide comment
@KupynOrest

KupynOrest Mar 1, 2017

Contributor

Completely forgot to update my examples, sorry for that, here is the latest version

|a b c d|
"This is how we can create a matrix, a and b are 2x3 matrices in
this example"
a := PMMatrix rows: #( ( 1 0 1 ) (-1 -2 3)).
b := PMMatrix rows: #( ( 1 2 3 ) (-2 1 7)).

"Matrix product"
c := a * b.

"Elementwise matrix product"
d := a dot:b.

"This is how we can create a vector"
a := #(1 4 9 16 25) asPMVector.

"Vectors and Matrices support basic logical and arithmetic
operations"
Float pi sin * d.
a sqrt.
a > 3.
c cos.
c < 0.

"It is possible to create a vector/matrix of random numbers"
a := PMVector randomSize: 10 maxNumber: 3.
b := PMMatrix rows: 2 columns: 3 random: 5.

"It is also easy to create a vector/matrix of zeros/ones"
a := PMVector ones:15.
b := PMMatrix zerosRows: 2 cols: 3.

"We can also compute the cumulative sum or regular sum the vector/
matrix as following"
a := PMMatrix rows: #( ( 1 0 1 ) (-1 -2 3)).
a cumsum.
"a PMVector(1 1 2)"
"a PMVector(-1 -3 0)"
a sum.
"a PMVector(2 0)"

"Matrix trace (sum of a diagonal elements for a square matrix)"
a := PMMatrix rows: #((1 2 3)(4 5 6)(7 8 9)).
a trace.
"15"
Contributor

KupynOrest commented Mar 1, 2017

Completely forgot to update my examples, sorry for that, here is the latest version

|a b c d|
"This is how we can create a matrix, a and b are 2x3 matrices in
this example"
a := PMMatrix rows: #( ( 1 0 1 ) (-1 -2 3)).
b := PMMatrix rows: #( ( 1 2 3 ) (-2 1 7)).

"Matrix product"
c := a * b.

"Elementwise matrix product"
d := a dot:b.

"This is how we can create a vector"
a := #(1 4 9 16 25) asPMVector.

"Vectors and Matrices support basic logical and arithmetic
operations"
Float pi sin * d.
a sqrt.
a > 3.
c cos.
c < 0.

"It is possible to create a vector/matrix of random numbers"
a := PMVector randomSize: 10 maxNumber: 3.
b := PMMatrix rows: 2 columns: 3 random: 5.

"It is also easy to create a vector/matrix of zeros/ones"
a := PMVector ones:15.
b := PMMatrix zerosRows: 2 cols: 3.

"We can also compute the cumulative sum or regular sum the vector/
matrix as following"
a := PMMatrix rows: #( ( 1 0 1 ) (-1 -2 3)).
a cumsum.
"a PMVector(1 1 2)"
"a PMVector(-1 -3 0)"
a sum.
"a PMVector(2 0)"

"Matrix trace (sum of a diagonal elements for a square matrix)"
a := PMMatrix rows: #((1 2 3)(4 5 6)(7 8 9)).
a trace.
"15"
@SergeStinckwich

This comment has been minimized.

Show comment
Hide comment
@SergeStinckwich

SergeStinckwich Mar 13, 2017

Member

Code and examples commited in PolyMath v0.82

Member

SergeStinckwich commented Mar 13, 2017

Code and examples commited in PolyMath v0.82

@SergeStinckwich SergeStinckwich moved this from In Progress to Done in Small exercices for Ukranian students Dec 31, 2017

jecisc added a commit to jecisc/PolyMath that referenced this issue Jun 28, 2018

jecisc added a commit to jecisc/PolyMath that referenced this issue Jun 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment