Live CEOing Ep 671: Language Design in Wolfram Language [DateObject, IntegerChop, and More]

Transcript of a Wolfram Language design-review meeting (Live CEOing Ep 671, Jan 11, 2023) led by Stephen Wolfram with Christopher Wolfram, Michael Trott, Brad Klee and others. Main topics: 1) Naming and behavior of an "integer-chop" operation — discussion favors naming it Integerize and making it tolerate a tolerance (like Chop) and possibly generalize to snapping to other rationals. 2) Hard-body (hard-sphere) simulation design — trade-offs between event-driven hard-sphere algorithms and differential-equation N-body simulations; proposal to implement a dedicated HardSphereSimulation with radius/mass/position/velocity, event-limits, boundary-condition options (reflecting, absorbing, periodic), and event-list/causal-graph outputs; visualization (position+velocity vector tails) and documentation enhancements suggested. 3) RandomInstance vs FindInstance and MCMC — exploring packaging for sampling constrained spaces, clarifying whether samples represent uniform distributions or arbitrary heuristics; MCMC usefulness and challenges (mixing time, diagnostics). 4) DateObject(entity) and timeline behavior — deciding which date properties to expose (single dates vs intervals), conventions for ambiguous cases, and integration with TimelinePlot. Additional brief items: Softmax function (likely covered by neural net layers), formal variables/universal algebra topics.
Chapters
Hello, everyone. Welcome to the. I think it's the first Wolfram language design review of 2023, if I'm not mistaken. So this is part of our Incremental Language Development series and we have a variety of topics here. Ok. Integer chop.
So we started talking about this really briefly in the previous meeting, but the idea is that chop is a fairly useful function for taking approximate zeros down to zero. But it only works on zero. It's more specific than round, obviously. And Ed had put together a WFR function that does this for arbitrary integers.
Why isn't this floor? Because it doesn't. Because. I see. Because it only does it within a certain range.
Yeah, it's only doing it within a certain tolerance.
It's flaw with a tolerance, effectively.
Well, I don't know, is it round or the tolerance? Right.
Yeah, but it's none of the above because it's not always making an integer.
Right.
Which is why integer chop isn't a very good name for it. Because it doesn't always make an integer. That's its whole point. I mean, if it's. If it says. Yeah, see.
Yeah, it's sort of like a. It's sort of like a snap, like it's snapping to a grid or something.
But it doesn't make easel. Sorry, doesn't make version a number easel.
Well, I know, but that was a. That's a version one name that probably wouldn't be. I mean, this is.
It's more or less the same thing.
Well, but now what. What happens if I have point, you know, if I have this integer chop thing and I have. Oops. And I have 6.9999. What the hell's that? Is that just a print form?
I think that's a print form. Yeah.
So it's a downward chopper.
I thought that chop it does within a tolerance. I mean,.999 is not close enough.
Yeah, you might need more nines.
But I don't understand because chop.
Do like 10 nines.
Maybe it should be integer.
Well, I think the point is not the chop is the problem. The problem is the integer.
That's a fair point. Yeah.
Right. I mean, I assume that the point is that there's a two argument form where the second argument will be, you know, one half and then it will chop to the nearest half.
Yeah, I think so. Well, tolerance, that's.
I don't know. That's not the worst issue in the sense that it's sort of an extension.
You know, from a linguistic point of view, chop may not really make sense for the 6.9999-9999 case.
Yeah, I mean basically what the. The overall goal of the function is. Take an approximate integer and turn it into an integer if it's within a certain tolerance.
Right, right. It is like snapping to. I mean it's like, you know, if you use any kind of graphics editor thing, it sort of snaps to a grid.
That.
That's exactly what this is.
Yes, Integerize.
But it's not integer.
Well, again it. I see that's I guess the primary use.
But I actually like Steven's name because it's very much like Rationalize. I mean if within the tolerance it works. If it can'.
You can't.
Well, what, what Christopher's bringing up is, is that we can extend it to non integers to. To other rationals, for example, but we.
Have many functions where it's primary name.
Yeah, I. That's what I'm saying that. That's why I also think Integerize is perfectly reasonable.
Well, maybe the only other problem with integer eyes would be. And maybe. Well, I. I'd be a little afraid that people would say, oh, I've got something that isn't an integer, I want to make it an integer. And what they want is round or floor or something like that. And they say, oh, integerize. Well, Rationalize doesn't always return irrational either.
I know that point was made, but it's not clear. That's a great feature of Rationalize.
How about Round Shop?
It strikes me as incomprehensible. Sounds like a piece of meat. It does.
But you know, round does.
The same or you know, chopped has this thing where sometimes it apparates and sometimes it leaves it unchanged. So I think that's good to be in the name.
Could Rationalize possibly just be given extra cases?
No, I don't think so. I think it's too obscure because this case here, I mean, how does Rationalize work? Let's see.
Sorry, I was on mute. It's a continued fraction approach.
No, I know that but I mean it is details.
It explains. It's in the details.
Right, but I mean also. But the DX here is a tolerance rather than a snap grid.
Yeah.
Well, which is more useful? Maybe the tolerance is the more useful second argument, I think to rationalize.
That's the case for this integerized. I'm less certain.
I mean, but Chop also has a. Takes an epsilon, right. As its second argument.
Yes, it does. Which suggests this should as well.
Yeah. And then what if. I mean, it seems I'm trying to Think of when it would be useful to. I mean if you wanted to snap to nearest half or another version would be. Maybe you give it a list of values to snap to. But I'm not sure how useful those are. I mean those are the obvious generalizations.
I mean, I think. Yeah, it's either. I'm trying to think about whether that list of things, you know, that's a bunch of catchment basins, so to speak, that you're giving it. It's like nearest essentially at that point.
Actually you could. That's true. And in fact you can even write it with nearest because nearest has a syntax for. It's a little obscure for only finding results within some radius.
Right. Well, I think we should consider Integerize. I think it's. I think it's an understandable name and I think it's. I mean, let me think about this for a second. Yeah, I think, I think it's a reasonable name. Anybody object here? And we're basically doing an X DX type of deal.
Okay, I think that makes sense. We'll review it again and consider then when we finalize it.
But yeah, okay, we just work on around.
We're going to round.
Why not if it's within the dx, just crush it into an integer. Seems right to me.
Yeah, I guess we do.
Intervals and quantities would be nice.
Maybe 10 intervals, but not intervals.
Why? The whole interval is within dx. Maybe also what's the default dx?
Presumably the one for chop.
Yeah, what is it like machine.
It's not machine. Epsilon.
And just to make sure that we're all on the same page. It also works for rationals that are a tiny bit of.
I think so.
And Gaussian integers.
Yes. Well, it's 10 to the minus 10 now. Chop should really have a tolerance option. No, actually we are saying it has it as a second argument.
Yep.
It's just the way we do documentation now, we should put that second argument up into the main usage.
Yep, I'll move that up.
Okay. Hard body systems.
Yes.
So we started talking about this also last time. We have Rob here also because we had talked about potentially either generalizing what we have in N body simulation to work here also or doing basically the same thing for hard body simulation.
Right. And since, you know, the fact is that the more I look into this, the number of people who've used hard sphere gases as a model for things or hard objects is just so freaking large going back, you know, forever and.
And the main use today is active for jamming natural dynamics anymore.
Fair point. Okay, so the way you're doing, do.
The jamming problems have multiple incidence issues?
They're static. They're not dynamic.
They're not dynamic at all.
No. And they have more. Yes. Otherwise they are not stable if they not have multiple points.
Yeah, but. Okay, but I think the thing we're trying to do here, okay, I don't understand why we wouldn't want something which is a combined n body simulator and things are gravitationally attracted and then they bounce off type thing. Why wouldn't that be the.
What one. One thing is at least my experience that the. It's sort of hard to get simulations like that not to. Not to have crazy like things like. Right. You. You get sort of singularities and stuff very, very easily and you get weird situations.
What kind of singularity?
Well, I just mean if you, if you have collisions, it's sort of. For example, like if you have like adaptive sampling the way, I mean if you just do it with like a one event kind of thing, it's going to be. Well, like there's standard ways of solving the problem of singularities without collisions. Like where you just use some Hooke's law thing when they get too close or you just, you know, have a tolerance where within this radius you just don't apply the attractive force or whatever. There's nothing that I found in the past really like that for collisions. I. Maybe we can make something up and it'll be close enough.
But yeah, like, like within epsilon layer where Epsilon don't know, 10 to minus 6ish, 8ish. We have a potential that goes smoothly from zero to infinity.
Well, that's not what these things. I mean, look, these hard spare simulations are based on algorithms that really are just geometrical algorithms about.
No, no, this was for the case where we have both cavitation plus parts field.
Yeah, I understand, but that seems like it'll be. Look, the fact is. Okay, the question is, is it really. And it may be essentially a different domain of operation to be dealing with genuine hard spheres as compared to dealing with potential.
Absolutely. Yeah.
Well, which is just. Yeah, yeah. Okay, fine. So then it's. Then maybe we should just have separate functions and not pretend we're going to do the two together. And if you want to do something some, you know, repulsive potential at short distances, then put it in body simulation and maybe we have a standardized potential that does that.
Yes and no. I mean what we do right now in anybody simulation is based differential equations. The name doesn't suggest this in any form.
Well, what else Would we do other than differential equations? I mean we're doing equations of motion.
I'm confused, but the name N body simulation just suggests there are interactions between N bodies. And that's exactly the case for the hot sphere gas.
I know, but people, usually by n body simulation people have usually evolved to mean this differential equation based thing.
That's correct, yeah.
I mean you could, I mean if you really want them together, you could have two separate cases and you. We just give a message if somebody tries to mix. But I mean that's essentially having two different interfaces anyway.
But then, then it will be n body simulation instead of harmonic, for example, we'd say hard sphere or something like this.
Yeah, right.
Well, I think one reason for having two different functions is because we might want different output forms for the.
That's a good point. Because there are discrete events in the case of hard spheres, which there are not. Yeah, that's a good reason to do that.
And you know, some of my experimental stuff has output forms that we could possibly look at. It's not a list of coordinates and times and stuff, it's. It's an event list.
Yeah. Which is something we can get there. Which is completely unavailable in the continuum case.
Yeah, yeah.
And then also, I mean, let's say we're adding in gravity. Well, I think that the gravity will be like we have one in body simulation solution between each event that happens. And the events are actually kind of like singularities because they're involved. Discontinuous changes.
Yes, but is that realistic to have a. Okay, question. I mean this. What are you proposing? Are you proposing some combined function?
I mean let's just, let's just look at how the hard sphere algorithm works. These things are going all over the place. They collide and when they're done colliding or when they're in between collisions or wall reflections, they're just doing like a Galilean translation.
Yep.
So the thing that changes in the algorithm when adding gravity, which I think this is really interesting to add gravity because then, you know, we could do hard spheres bouncing in a container or whatever. That'd be pretty cool, I think.
But, but the problem is you will no longer be able to compute when the next collision happens.
You can maybe compute when the next collision happens using something like n body simulation.
That's not obvious to me then.
It's not, it's not good enough. It would be obvious.
You'd have to have an event and the time step would probably have to be set so small it's not realistic in general.
But what about if you can symbolically solve the equations of motion?
So for two bodies.
Yeah, okay, fine.
Even Hooke's law, you couldn't do for many.
Good point. Well, you could make an approximation.
Yeah, but then we got the same problem of it being off.
You might get one step further with a clever beta answer for Hooke's law.
Yeah, yeah, okay, fine. Well, I mean it suggests. All right, so basically the conclusion is let's be realistic in what's possible and just say, you know, we are basically, for now we're just doing hard spheres and we're doing, you know, we've got the N body simulation and we've got hard spheres. I do think that, you know, we are beginning to, to sort of go into a general domain that includes things like agent based models. I mean this is the same type of thing where we've got properties of essentially discrete objects that then have, you know, dynamical behavior and so on. And, but I mean it seems like the design of embody simulation. Okay, who, how do people feel? I mean the times I wanted to use it, it's, the design has been pretty decent. What do other people think? Yeah, okay, and how similar is that design, Brad, or others to the hard sphere simulation design?
Well, one issue that I was thinking of is like if the, if the output of an event chain algorithm is very similar to a causal graph, then the users might want to know where the particular mass is as at an intermediary time. So there might be a different algorithm that we would need for interpolating the causal graphs to get.
Fine, but the point is that there are causal graphs are a possible output for a hard sphere simulation in a way that obviously, I mean, we still don't have.
Looking at it, I've been looking at it lately that the causal graph is actually the fundamental output of the algorithm, but it's carrying a little bit of extra information on the nodes or on the edges.
Sounds right to me.
Right.
Well, interpolating function does have a mechanism. This was set up for the win event stuff. I mean, I don't know if it'll be useful, but it does have a mechanism for discontinuities and interpolation between, you know, for points in between discontinuities.
That's, that's, I'm not sure that that's the same issue. What I'm really talking about is like, okay, you have this big graph with a bunch of nodes in it and you don't necessarily. And the nodes kind of have some time stacking. But if you want to find out where the node for or where particle three was at. You have to look at the events that Particle 3 was in. But in the linear order of events with time, you don't necessarily know where the first three event is going to be, nor the next three event. So it's a little more difficult than just interpolating the type of output that you would get.
Fine, yeah. So you need a different data structure that's.
Yeah, you need some interpolating function that's sensitive to the data structure.
All right, question, are we only doing hard spheres? Are hard squares a possibility?
Well, the hard square code, I'm just thinking of it right now as a pathfinder. Whatever. We get to work with the hard square code. We can potentially get to work with the hard sphere code. Except that I think that the hard sphere code is really nice when it gives us solutions that are entirely over the rationals. Those are the easiest to compute. We never lose precision. But then with what I'm expecting to happen with the hard sphere case is that even if we can get exact numbers for intermediary states, they'll probably become huge expressions. So that memory will slow down the computations and necessitate numeric approximations.
Okay, but we should allow say a couple thousand digits because this is totally.
Realistic and you certainly can't do that with algebraic numbers. That many collisions that you're talking.
Right, but okay, I'm trying to ask, are hard squares are non rotating squares? Right, yeah.
Hard square thing is great.
But how, how seriously, I mean, what are we going to call this function? And are we mostly going to say it's a hard sphere function, but it'll have some opportunity to do hard squares, non rotating hard squares.
It should be hard sphere based where anything else is just, I don't know, a curious extension because of the fact that it doesn't support rotating.
You could just claim that they're topological spheres. I think this is about geometry.
I know that would give you freedom.
For all kinds of shapes in the name.
Yeah, well, I haven't actually asked the question whether it's still possible to get exact solutions if you allow weird, weird shapes and rotations.
Probably quite difficult, but. Okay, let's just go through this. So what we've got here is some options. So we don't have a radius. There's nothing like radius, is that there's an N body simulation. It's just mass. I mean here we also have a mass. Presumably we have the same things, mass, position, velocity, except these are point particles. Right?
Yeah.
So we probably just want to call it radius, mass, radius, position, velocity, etc. Default radius is 1. Right. And we probably want to have. I mean, I don't know what steps means here, but this thing here is a time parameter and it's the same deal as this would also have a time parameter, presumably. Yeah, that makes sense. And N body simulation has an output. I think it has multiple output possibilities.
Yeah, you look at the data, it gives a data object which then you can query for stuff you want.
Where does it say what you can query it for?
Well, go to the, go to the page for N body simulation data.
Where the hell's the information? Wait a minute. What the hell's going on here? How do I just get a list of positions? Oh, I see. State of body. Right. Well, okay, I mean this, this seems about right with a given property here. And then in terms of this combined properties, there will be a causal graph as one of the possible things here. Right? Or instead.
But is the total kinetic energy as a time dependent? I mean it maybe is invariant, but it's also. Is that evaluated per time?
I don't know. Can.
Yeah, you can.
You can plot for. For the ND solve situation simulation. It's, it's. It's evaluated as a function of time.
And assuming it's a conservative potential of some kind, it should be. It should be constant.
Right?
Okay.
Yeah. So the causal graph is almost bigger than.
So. Sorry, sorry. No, the total kinetic energy is not preserved.
Right.
Because the interaction in the energies, the.
Total, the total energy. That's the third one there, Michael. I mean it's not. It doesn't always work that way because of. And itself has errors. But you know, it can you see the variable.
I mean each time you should be able to see the variable theorem. Is that true, Michael? Between the kinetic energy and the potential.
I think in average. If you have enough. Yeah.
Okay, so.
But looking at the causal graph is like looking at the whole data blob and then asking for a particular state of a particle at some time is like looking at a slice of the data blob.
Look, I think we've got a basic plan here. These things about boundary conditions, we obviously don't have that. In the case of embodied simulation, presumably we could have an outer boundary. We haven't wanted that particularly, but I.
Don'T think it'll be for in body simulation data.
An outer boundary for the.
Yeah, there's, there's. I mean if I point out the. There's an example where it's done in a. In A region.
I don't want to see an example. I want to see it in the documentation. Is it. Is there a way of specifying a finite size region in N body simulation?
Yes.
And you don't. But you didn't document it.
That may not have been documented.
That's very bad. Oh, region. Wait a minute.
Yeah, yeah, that's right there.
I thought.
I somehow thought it was there, but.
All right, well, fine. No, I mean, you know, this is very lame documentation. I mean, come on, we can do more than 10 examples here. 11 examples for this function with all these pieces, please. Could we add some examples, Rob, or.
Yeah, I'll talk to Roger, see if we can get somebody to add some examples.
Well, if Brad is looking at this stuff, maybe he could add some examples.
I probably could. The Virial theorem thing sounds interesting to me.
Yeah.
Well, this is perfectly reasonable what you have here. Where's the. There it is. A disk. Okay, that's nice. That's nice. That's exactly what we should do here too. Now, I don't know whether there are graphics that are non trivial in the hot sphere simulation case. Maybe these things with tails and so on might want to be one of the properties is something that can readily give you that. The tailed graphic, so to speak. I think that's another thing that would be nice here too. Oh no, I guess not. Because you can't show tails because there are no. Well, we could show the instantaneous positions of the bodies together with their velocities as tails. Does that make sense?
Yeah, sort of like a. Like one of those fish plots or whatever.
Whatever you call them.
Yeah. At least as a wfr, that should be a thing we have. I mean, I would even argue that that's a, you know, having a type of plot, having something which is a, you know, position velocity plot would not be a terrible thing to have as a standardized plot type. Michael or anybody else. You want to comment on that?
I don't think plots in general are what people do in this world, but much more correlation function averages.
Well, I know that's what they do when they're writing research papers, but it's not what they do when they're exploring things. I would like to propose that we consider some kind of plot like this that takes, you know, xy. I don't know how we do it. Dx dy. I mean, I guess I've wanted this many times when I've written. It's not very hard to write, but it just seems like the kind of thing we should have Some way to do. Maybe it's effectively a velocity plot of. What is that called? List. Not stream plot, but the other list vector plot. Right.
Yeah, but that. That kind of plots a vector field, doesn't it? And you just want to plot.
Yeah.
Few points that are not. Not the whole field.
So it's a little bit different.
Yes, it is. Oh no, actually look at given at specified points. This is exactly the thing I'm asking for. Well then we just need an example. In list vector plot, we need an example of embodied simulation. In embodied simulation, we need an example for a spectra plot and then we have it solved. That makes sense.
Yep. Do you want to do that, Brad, while you're looking at this stuff?
Sure. Yeah. I need to get some training on updating documentation anyways.
Okay. All right. So I think we have a plan here. There's. Are there any other different things that need to be specified other than a radius option? A radius thing here. And we won't have a first argument. It'll just go straight into this list of parameters here and then we'll have a time, you know, a time that we want to compute it for. We should have the possibility later of adding a string first argument. That makes the hard sphere not actually a hard sphere. Does that seem reasonable?
Yeah. Or something to switch it over to the hard squares, you mean?
Yes.
There's one other thing that I could think of in terms of the argument structure that the calculation works a little bit like nest while. And you could put a time in there where, you know, the. This mass of things that starts going crazy with a bunch of collisions and then the computation hangs. So you might want an extra parameter as a cutoff for the number of events that you're willing to calculate.
Fine. Well, that's a max. I'm sure we've got. What's that?
Max collisions.
Do we have any option that could be reused for this?
Well, max iterations perhaps if you consider a collision being an iteration.
But I don't like that.
Little bit too tricksy.
I think it could be max color. That's fine.
Yeah.
Oh, as an option. Because in the nest while it is a full argument.
I know, but that's a very different kind of thing.
No, that's.
I. I do also think that it might be worth supporting an up to 10 or something like that for the time. Does that make any sense?
Yep.
It would be nice.
Why up to.
Yeah, why up to.
Because if it blows it. Yeah.
Makes exponentially small time zip increments before the next.
Yeah, but that's always. That's always implied, like ND solve. We don't.
You.
I mean, up to is really an integer thing.
And.
And this is. This is a slippery slope. And ND solve, for example, we integrate as far as we can and then give them.
As it blows up.
And it also shows in the result how far you integrated.
I don't precisely.
Yeah, and presumably might make sense here.
The simulation data should so show that. I mean, that's one of the things here, is the simulation time. Right. So it would.
It would be nice to have periodic boundary conditions, even if the equations of motions aren't physically realized in flat space.
I'm sorry, so what were you saying, Michael?
Instead of reflecting, it would be nice to have wrap around boundary conditions. Yes, it would be both or a single one. So you can in principle simulate a long channel or something like this.
Yeah, right. But what happens for N body simulation with periodic boundary conditions? Do we have a way of doing that? Because you have a region option that doesn't give you a way to make it periodic.
No, we don't have.
But this doesn't really make so much sense because there the force field would discontinuously change because you go somewhere else. But here, without forces, it still is a smooth continuation of the path. When a topological torus.
Why can't you have. Am I being silly? Why can't you have forces on a torus?
No, no, no, you can, but then kind of, you flap around at the full moment, the distance is suddenly changed if you go to the left side from the right side.
I see, yeah, I see.
Then you must really embed it topologically.
Yeah, yeah, yeah.
On the doors from the beginning.
Right. Okay, so how will we do that in this case? We'd have a region arrow. Well, how would we specify the periodic region then? It's got to be rectangular, doesn't it?
Yes. Yeah, I was thinking something like. Like up, down, left, right, and reflecting periodic absorbing.
All right, we have to. But. So this is similar to our PDE boundary conditions in some sense. Do we. Don't we have periodic boundary conditions for PDEs?
We have the symbol. We don't have a proper implementation.
But can't we reuse that symbol at least for this?
We'd have to talk to Oliver, because the whole.
Not really, because it requires a mapping from one parameter size of the boundary to another parameterization on another boundary.
All right, so anyway, more discussion about how to specify periodic boundary conditions, but clearly it's a useful thing here. And do we want to talk about it more right now I think it needs to be dug into in more detail. And you're suggesting that we have absorbing, reflecting, periodic boundary conditions.
That would be the obvious ones that come to mind for classical mechanics.
Okay, what is this MCMC method from Etienne?
Those are. I think that's a non deterministic solver, right?
Okay, what did Etienne in fact do here? This was Etienne's prehistory. What is this doing? And this is this. This is. This is trying to determine configurations of hard spheres. Is that true? Huh?
Okay.
What is the story of our implementation? Or, you know, what we should do with, you know, MCMC methods? Michael, you've been talking about this repeatedly.
Because it was the number one choice for people in Covid times to model Covid propagations. This case is now a little bit over.
Yeah, When I saw it, it was used for cosmological parameter extraction.
How does it. I mean, is it not relevant for other purposes?
Not sure what general stuff you would have. Yeah, I mean, in general, I think most MCMC stuff, it's basically. I mean, it's a fancy random walk. It's not even a fancy random walk a lot of the time.
Well, what is.
You're saying there's no particular wrapper function that will be useful for it?
Not that I can immediately think of.
I think it would be filed under probability and statistics. Because my recollection of some of the stuff was that you're trying to recreate a posterior distribution or something like that, right?
Yeah. Like most of the uses that. That I've run into have been. You have some extremely complicated distribution and you're trying to sample from it, you know, quote unquote, uniformly.
Maybe we already do this. Maybe this is what we already do for.
Well, no, it's stuff like. I mean, this one is a bit too hard, I think, even for mcmc. But it would be something like you want to sample uniformly from the set of all possible chess games. Right? That would be something you'd use. I mean, I think that one is a bit too hard maybe, but that's the kind of idea.
What does it even mean? What does that even mean?
Well, it would be. If you have a set of all possible chess games, such as set exists, pick one uniformly at random.
I see what you're saying. Where each one is weighted. Where a game is weighted, every possible beginning to end game is equally weighted.
Right. I'll give you an example of a concrete one, right. Where people use MCMC for this. So if you have, say, a big network and I say partition, this network into 10 pieces that are connected, 10 connected components. And give me, you know, there are many different ways of doing that. I want you to uniformly sample some random partition of the network into 10 components. So people use MCMC for that. And basically the way it works is that you, you pick some arbitrary partition, 10 components, and then you do a random walk where you sort of change your partition little by little. And you can show that in the infinite limit, if you do this random walk forever, the stationary distribution is uniform and you're uniformly sampling.
Right. Fair enough.
So, likelihood function where with the Monte Carlo Markov chain.
Which thing?
Well, isn't the input part of the input specification a likelihood function?
I'm not sure. I think the main thing that you have to do to do mcmc. So first of all, when you're doing the random walk, you generally have to, to weight the. In order for. Right. You have to weight the different sort of edges depending on the degree the in degree of the different vertices. That makes sense. So it's a biased random walk depending on how often you expect to, you know, encounter different neighboring vertices.
Is that the likelihood function?
I'm not sure. I'm not sure.
Okay, but. All right, so the question there is, is there any packaging of this MCMC thing? Well, I mean, this is very similar to what we were talking about before with, for example, this, you know, you're saying, give me a random, for example, a list, a list with all kinds of complicated characteristics. You know, there are no pair of identical elements together, and there's a triple at this distance, et cetera, et cetera, et cetera. And then you say, give me a random thing that satisfies these conditions. Right.
But there's no magic there. Like, you know, in order to do a sampling like that with mcmc, you have to, basically you have to come up with, you have to come up with a random walk set up, and you have to prove like five things.
Yeah.
Just prove that you're gonna. It's connected and stuff like that.
Right?
I mean, maybe. Yeah.
Well, I was just gonna say maybe one general thing, but I don't really know enough about this to say anything. I, I've heard. So one of the big issues with MCMC is the mixing times. So that is, you're doing this random walk in, in the infinite limit, you know, you'll be uniform. But in practice. Well, I think often a lot of uses, even, you know, if you run it for a billion years, you won't even be very uniform. But that's a different issue. But but there's supposed to be. I think it's very hard usually to prove just a priori what the mixing times should be. And so I've heard that there are certain visualizations that people use to try and as their thing is running to try and guess how mixed it is. I don't know how any of these work. I don't know what they are. But I've heard that such things exist.
I can guess.
It's.
Yeah, it's like making. In random cellular automata, you make one, you know, a change in one place and you see how that grows.
I mean, I think the problem is actually similar to one that genetic algorithms have, which is with the genetic algorithms have a fitness function, but if the fitness function or the likelihood function have local minima that are significantly deep, you might not be able to.
Yeah, I mean it's the same. It's the same thing in all these different schemes. But the question that I have is, is there a useful packaging of a function which we don't necessarily know how to implement in many cases, but it's just given a constraint, find a random example that satisfies this constraint, that random instance. It is random instance, but it's random instance, which we've only done for very particular cases right now.
Well, I think there is not a general case.
No, I understand that. But I'm asking. We could. We might be able to pile on some other things, like some things with graph properties and so on. I mean, I hadn't really thought about this as a pattern for. What the heck is that one? Such as a biomolecular. What the heck is the biomolecular case.
Where you can have meta characters in your sequence.
Okay, but so this random instance thing is then becoming the carrier of many kinds of things that could be of this type.
Yeah, I mean this is. There's a more general, I think, design thing about. I mean there are a couple of functions like random Instance and delete Object, maybe a couple others that have been these cross domain functions.
Yes, yes, but I think random instance, what I'm suggesting here is that we have a little bit of a think of how else, you know, random instance will be increase its visibility if it goes into another five domains. And you know, we've got specific things like random word, random point and so on. And we don't really have a good way to say. I mean, we don't have. We don't have a way to. Basically you've got to describe a set in some way. I guess this is a very yeah.
It'S more like you have an abstract or not fully determined thing.
Yes.
And a particular instance of it. I don't know that it's really like sampling from a distribution per se.
But it is sampling. I mean even this is sampling from the distribution.
Sure.
In a certain way.
It's sampling from the space of solutions, not from a distribution.
Well, they're just the same thing. I mean it's just a distribution where the probability of it returning integer is zero.
We don't know what the distribution is that this generates. There's like randomness in the initial conditions and then it does some solving.
Right. We don't know. Right. We don't know if the. For example, if the distribution is uniform. But you know, like. Right. I mean, you know, the probability of returning integer is hopefully zero.
But.
Well, but also this thing is set up to try and make nice looking instances, not degenerate ones. Right, right.
I mean, I think, I think the point. The point though is that random instance, in principle it's one argument is, you know, its main argument is a distribution spec.
Right. But I mean, my question is this.
No, it's all right. Sorry, Christopher. I think, I don't disagree. It's not a distribution, it's a set of constraints. Constraints. And it wants to get one possible solution. I don't think a distribution is involved.
Okay. Sort of.
Yeah.
I mean, I think I. Right. As it's set up right now. You're right. It's basically a set and it's not saying anything about. All it's saying is it's going to sample from that set and not things that are outside of the set. But it's not saying anything about the distribution.
Exactly.
Within things of that set. But if we had a more general, you know, if we want to make all the random functions together, which I don't think we really want to do, but if we were, that function would take a distribution and I think these sets of constraints can be thought of as distributions as well. It's just they're not fully specific.
Well, look, find instance is another example of something. Findinstance is much like random instance, isn't it? What's the difference between findinstance and random instance?
I would have guessed a priori that the difference is that random instance makes more promises about sampling uniformly or something. So we know that's not the case.
No, I think it is the case, at least for the examples that we have here on the documentation page.
But weren't we just talking about how the geometric scene case. It tries to pick beautiful examples and stuff like that.
But it's still a much larger space than if you run it a thousand times, you get 950 different. If you find instance a thousand times.
You get the same instance thing. Yeah.
Okay, so find instance is deterministic or random instance is not like find instances is deterministic but perhaps unpredictable. This is determinants non deterministic and unpredictable.
You can do random instance comma in sort of table.
Yeah, well, who knows what the distribution of these things is and even what it would mean. I mean, it's a. I think we should think about what other things we could have random instances of. Because I mean like this, for example. I don't really see why there isn't a way to ask for a random value of X that satisfies this. That is a well defined thing. It's a uniform distribution, let's say, over this region and that we presumably do have a way to ask for that. It just isn't packaged as given a constraint and random instance. Okay, let's put this for another time. Let's try and think about what random instances might be, what other things might be subject to random instances. All right, let's take a quick look at some of these other items here if we're ready to go on.
Okay, this is something that we've suggested off the cuff a couple of times, which is that much like geoposition of an entity should give a geoposition that date object.
I agree.
I think it should.
So the main hitch here is that there are a lot of possible date properties. In some cases it's straightforward. You know, date is fine for a nuclear explosion or for a historical event, but for things like movies, it's probably a release date. For things like a dinosaur, maybe it's discovery date.
For a building, never discovery date.
Yeah, for building, it's probably construction end date. But for a lot of other cases, maybe a date interval makes more sense for a person date object, maybe birth date. There's a lot of ambiguity in terms of what we would do in a lot of domains and I think we either.
Okay, let's think about that for a second. Okay, so there are dates that have a. Is Jose with us today?
He's not here today. He's going to be back next week for it.
Okay. Okay.
All right.
There are things that have definite. By the way, I assume that date object of an astroposition will extract the correct thing.
Yeah.
Much like date object of a geoposition will extract the date if that information is embedded.
All right, so the Question here is, okay, what are some categories? I mean, look, clearly a date object of like a battle or something where we have. Well, okay, what about a war that had a date interval? In other words, can date object date object supposedly returns a single date object? Go ahead.
I think it would be very confusing if a date object date object of entity returned a date interval.
Yeah, I don't think it can return a date interval without things going awry. The arguably could do what date object of a date interval does, which is give you the first moment in the interval. But that's going to be a little confusing.
Yeah, I mean, the other thing is just. I mean, maybe that would be the consistent thing to do if. Well, okay, so I'm thinking of like, for example, I think there are some cases maybe in like military conflict data or stuff like that where there are some entities that have a date and other, you know, there's like a property where sometimes it's a date, sometimes it's a date interval. Right. So you could never really return. I think there are cases like that. And if there were, you could never really return that unless you had some convention like what you just said of maybe you pick the. If it happens to be at an interval, you pick the start or something.
Okay, let's look at these. Which ones we think are realistic. Okay. What is debate?
Probably like political debate.
Why the hell do we have such a thing?
That might be a dev mode one. I ran this internally, so.
Okay.
All right, so like holidays on there. And that's not an exposed.
Okay.
Board game release date is okay. I think dinosaur. Absolutely not. Discovery date. Yeah, if there is a date, it would be first appearance of the dinosaur. You know, we'll be off by 100 million years or something.
Yeah, it'd be a very coarse granularity to begin with. I think in general, discovery date doesn't make a ton of sense. No, I think you want the discovery date, you look for it. Formulation date, maybe.
Yeah, maybe.
Yeah, I'm a little worried that, I mean, Right. It's just that I think it just seems like the whole construction is a little bit suspect in the sense of like, is it really good code to write data object of a person or something? Even if you happen to know that, oh, this would be the birth date.
I think there are certain domains where it's intuitive. Like we were saying, you know, a historical event or something like that. If there's.
Let's just look through this list. Okay. Dog breed, no element, no exoplanet, no famous algorithm. I think probably no Gem. No. I don't know, maybe on this one. Financial.
That's the same as the algorithm, though. I mean, I don't know, are games invented or discovered or something? Especially math games.
Those seem iffy. Financial is a no, I think. I can't imagine why that will be useful. Just get confused.
Yeah.
Genome assembly. That one I think is a yes. Holiday, presumably.
What does that mean? Genome assembly.
Oh, assembly 37 of the human genome.
For example, in the 17.
Lunar eclipse, I would think. Yes. Meteor shower. Sure. Mineral.
Although actually, sorry already for genome assembly though. I mean, this is the sort of thing where I think it could sort of get you into trouble where you just say data object of genome assembly, but you don't realize it's the release date and not, I don't know, when the sample was collected or something.
Well, I think for that particular case it's a reasonable thing because that is the only date. There is no sample collection thing. But.
Yeah, so this particular set here is just instances of domains where we only have one date property. There's a whole section below that where there's multiple dates.
Okay, but let's look at some of these of which ones. I mean, things like mountains. No way. Right. No way. Music Album release. Sure, why not? Same with movie. I would say the same thing. I mean, nuclear explosion. Absolutely. Planet. Absolutely not.
Right. I think the case is. Imagine you saw a piece of code where it said, you know, date object of, you know, I don't know, pick your favorite Star wars and you know, would that be readable? I think that's probably a yes.
Yeah. Shipwreck is a yes. TLD is probably a no. Even though that is a fairly well defined thing. I just don't think that's a. Okay. That's right.
The Data object of google.com does not. Does not make a lot of sense. That means.
Right. I mean, artwork. Sure. Completion date, I would say. Sure.
What's the start date? Oh, it's a start versus completion.
Michelangelo has.
Well, no, but you can't just say completion. So willy nilly. Because we were just talking about how the convention for date intervals is. You take the first.
I think by the time only the left foot of the statue is done. It is not. That is not the date of the artwork. And I would say this is the.
Sort of thing though where it's. I just, I'm afraid that it's just, you know, you're gonna have a piece of code where it's date object of, you know, David. And it's. It's it's going to be, like, totally unclear what that means.
I mean, the chemistry in our history is certainly to use the completion date. You know, you might have an interval in some cases.
But I think the point is that it's the el cheapo version. I mean, if you want to get it right, you're going to go in and look, which date is it? But it's just the. Oh, I've got these things, and I just want to do some rough. It's a courtesy.
Yeah. I was thinking it's analogous to geoposition of France. You're going to get an answer. It may not be. You know, maybe it's a representative location. That is a rough approximation of it.
Right.
I think that there are things that have a moment in time. Like an artwork has a plausible moment in time, even a bridge. I'm. I'm skeptical about. I mean, anything that's out there for a long time in operation, and it's not something where. I don't know.
I mean, do we have a standard way, by the way, for, like, if, you know, if you use geographics, you can give it a bunch of entities or like, geolist plot. Do we have a similar thing with timeline plot, where we've already decided resolving entities?
Yeah, that's what this is about. And that's what I mean, honestly, in. In resolving entities here, for example, for people, we really want the date interval, which I don't think we have right now, do we?
No, there's not a single date interval property. There's a burst.
If I say timeline plot of, you know, Alan Turing, you know, I don't know. That is pathetic. That's pathetic. Right? That should work, and it should work with date intervals. And yes, that is going to require us to have a canonical meaning, just like geoposition of France has a canonical meaning for what that is. I think here, you know, the date interval. I mean, like country, for example, presumably that is an independent state. I don't know. Maybe that one is hard to do, but this should do something.
Shouldn't the United States, for example, be when the Constitution was ratified, not when independence was won?
Okay, what's this? This is a.
This is an example with historical events that does an interval. It does start and end dates.
Well, great. So it should have people as well. Yeah. So we've already got a pattern for this. Mm. But we just need to figure out what some of these ones are. Look, things like, you know, a manned space mission, we can surely manage that. The. The date interval for that.
Maybe that's A good baseline is start with things that make sense on timeline plot. I'll sit down with Brett and Alan and just kind of itemize things.
Fine. I think the two cases, there are things that make sense in timeline plot. I mean, there's also the question of whether if you give date interval of something, if you say date interval of a person, maybe it just returns the correct thing, the correct date interval. That seems convenient. And some other things, prehistorical period.
Those all have a definite start and end.
Right. But also. There are things that have a moment in time character to them which can perfectly well return something. For date object. I think there are things where people will kind of know this is a courtesy, basically is what is really the thing here. If you want it more precisely, you've got to specify what property it is. What on earth is this? That's a bug.
That's a domain that isn't exposed yet.
But. All right, so I think we've got a plan here. So date object for, you know, for the things that have a single date, date object is good. For the things that have a beginning, end, date interval is good. And timeline plot should. Should try both of them, so to speak, should appropriately surface whichever one is the right one.
Okay.
And don't be too creative.
Yeah.
It should be intuitive what it's going to do. If there's ambiguity, then it probably.
Right. I mean, dinosaur on a timeline plot.
Yeah.
You know, we know what that is. That is not sometime in the 1800s. Right. It's. It's. I want to see whether the stegosaurus was alive at the same time as the iguanodon or something. And I'm probably out of date with my dinosaur name. So it's probably discontinued by now. I think the iguanodon was discontinued. Okay. All right. Okay. So we have a plan for this. Yes. Really happy with these.
I think so.
We're going to. We're probably not going to get far with this, but we might. We could just look at it again. Directed Zero. Do we have Rob here? Because Rob will be relevant to that. I think.
Grab already.
Already left.
Well, he's relevant to that. If we ever. Michael might be relevant to that too. I don't know whether Michael has. Michael's still here.
Yep. Director Zero would be nice to have.
Well then let's have a discussion about it. I don't know enough about it. More complicated clean up XML handling and trees. Isn't that something that's underway now within.
Yes.
Okay. General algebra, whatever that means. I mean, that's sort of universal algebra in some sense being able to do universal algebra, having a convention for universal algebra. Because universal algebra on its own does nothing. Michael, do you have any comments on that?
I don't know enough what exactly meant here. It just means, I mean team's not even algebra. Honestly from what I read, it's even a pre version of algebra. Yes, I mean algebra has already certain rules encoded. Otherwise not in algebra.
I think what this is about is arbitrary binary and unary operators.
Associativity would be something that's required for an algebra.
Or something.
But then you would no longer call it an algebra. Then you would preface.
I know, that's what people called universal algebra was just a thing that has operators and relationships and you don't specify the relations at the beginning. You just have an operator like a binary operator.
Right.
It seems like it might be nice. I mean it could be nice to have something where you'd have like ring plus ring times field plus field times, etc. And it basically just assumes that, you know, the variables on either side are elements of a ring, field, whatever.
Arguably this is what we have with the axiomatic theory of ring and field and so on.
Yeah, that is probably the nicer way to do it.
This is, look, this is part of the ongoing discussion about formal variables. And what do we mean by a variable? What do we mean by an operator? Because there's really formal operators as well as formal variables. Whatever happened to our formal variables discussion? Anybody know? Can we look at that again? We were having this discussion about the meaning of variables like a year ago.
Yeah, I'll bring that up a bit.
Okay, so I have a comment. Like something that people do recommend is having a couple built in rules for non cumulative multiply.
Well, we can look at that. That's part of the same story. All right, let's do formal variables, universal algebra, non commutative multiply. That's a topic. Okay, last item here. Softmax. Is there an easy story here?
I think the main easy story was that there's a pretty closely related operation that we do have a function repo implementation of.
But softmax seems to be a thing that is heard from. What's happening here?
Why?
Sorry, Is this just to be a function for running softmax?
Yeah.
Does the softmax layer not basically do that.
Lay. Oh.
Wait, I'm that I'm confused by that because I mean. Right. I don't see how this is just different from softmax layer also.
Yeah, but, but we, we also tend to just have functions that work on Lists. I mean, layers usually have a whole.
No, but they do work on lists. If you just do kind of. If you just do softmax layer open close of List 123, Pretty much all the neural network functions you can. You can apply a layer to a list and it will work.
Okay, but is this function interesting enough that it should just be available as, you know, the function softmax of a list.
I mean, I'm not sure when you would ever do it outside of a neural network.
What is the definition of it?
I don't remember, but it's some exponential thing.
Yeah, I thought it was some well defined thing like a logistic formula.
Yeah, it is. It's a very standard thing. But I mean, see, we also have, you know, cross entropy lost layer. Should we have a function called cross entropy loss? Oh, there it is. By the way, it's normalized to be XP comma total. Oh, sorry. When. When softmax layer minus one. Oh, but that's the default. Yeah. Okay. So.
Okay, what does the total do in the normalize there?
We just need the probabilities to sum to one. Oh, the total is that the second argument is what it divides by in order to normalize them. So the default is I think norm. So that the norm is one. But if you say total, then the total will be one.
I see, I see. I don't know. I mean, is this function something that is useful in general computation or is it only useful as a particular hack in neural nets?
I've never seen it used outside of a neural net.
Fine. Anybody else got comments on this?
I agree with Christophoff.
Okay, all right. We can. We can forget that for now. All right. Anything else here? Okay, until the next time. Thanks a lot. See you all soon. Bye.
More from Guy

Cheryl Strauss Einhorn | The Human Edge: Smarter Decisions in the Age of AI | Talks at Google

Rachel Glennerster | Innovation and the Center for Global Development | Talks at Google

Rebecca Winthrop | Rethinking the Purpose of Education in the Age of AI | Talks at Google

Dr. Robert Wachter | A Giant Leap: How AI Is Transforming Healthcare... | Talks at Google






